The next level is to simply load all extensions to +Object+. As a rule of thumb, extensions to +SomeClass+ are available in one shot by loading +active_support/core_ext/some_class+.
The next level is to simply load all extensions to +Object+. As a rule of thumb, extensions to +SomeClass+ are available in one shot by loading +active_support/core_ext/some_class+.
Thus, if that would do, to have +blank?+ available we could just load all extensions to +Object+:
Thus, to load all extensions to +Object+ (including +blank?+):
<ruby>
<ruby>
require 'active_support/core_ext/object'
require 'active_support/core_ext/object'
...
@@ -432,7 +432,7 @@ h4. +require_library_or_gem+
...
@@ -432,7 +432,7 @@ h4. +require_library_or_gem+
The convenience method +require_library_or_gem+ tries to load its argument with a regular +require+ first. If it fails loads +rubygems+ and tries again.
The convenience method +require_library_or_gem+ tries to load its argument with a regular +require+ first. If it fails loads +rubygems+ and tries again.
If the first attempt is a failure and +rubygems+ can't be loaded the method raises +LoadError+. On the other hand, if +rubygems+ is available but the argument is not loadable as a gem, the method gives up and +LoadError+ is also raised.
If the first attempt is a failure and +rubygems+ can't be loaded the method raises +LoadError+. A +LoadError+ is also raised if +rubygems+ is available but the argument is not loadable as a gem.
For example, that's the way the MySQL adapter loads the MySQL library:
For example, that's the way the MySQL adapter loads the MySQL library:
...
@@ -503,7 +503,7 @@ Model attributes have a reader, a writer, and a predicate. You can alias a model
...
@@ -503,7 +503,7 @@ Model attributes have a reader, a writer, and a predicate. You can alias a model