diff options
author | Jonathan Viney <jonathan.viney@gmail.com> | 2012-01-22 12:20:45 +1300 |
---|---|---|
committer | Jonathan Viney <jonathan.viney@gmail.com> | 2012-01-22 12:31:00 +1300 |
commit | 1d9357df3b30a3aa5a2418b0fe68aeacbb111500 (patch) | |
tree | a6f2922f3d370398327620454f44bf9b5c07a94a /railties/lib/rails/application | |
parent | 15a9b2c0d619fd29abebf56344e28011526b5c03 (diff) | |
download | rails-1d9357df3b30a3aa5a2418b0fe68aeacbb111500.tar.gz rails-1d9357df3b30a3aa5a2418b0fe68aeacbb111500.tar.bz2 rails-1d9357df3b30a3aa5a2418b0fe68aeacbb111500.zip |
Fix `$rails_rake_task` global variable warning without replacing the value of $rails_rake_task if it is already set.
Fixes #4591.
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index b9944bed26..7da495211d 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -2,7 +2,6 @@ module Rails class Application module Finisher include Initializable - $rails_rake_task = nil initializer :add_generator_templates do config.generators.templates.unshift(*paths["lib/templates"].existent) @@ -49,7 +48,7 @@ module Rails end initializer :eager_load! do - if config.cache_classes && !$rails_rake_task + if config.cache_classes && !(defined?($rails_rake_task) && $rails_rake_task) ActiveSupport.run_load_hooks(:before_eager_load, self) eager_load! end |