diff options
author | Jonathan Viney <jonathan.viney@gmail.com> | 2012-01-22 12:20:45 +1300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-22 08:43:18 +0100 |
commit | 9ab290482284afbdc6830d84b33da03069073d4a (patch) | |
tree | 9928b9601fd5c27469f2618eb4fbc037f9171536 | |
parent | d5dde3734b715c95665451380f774f9c7dfde584 (diff) | |
download | rails-9ab290482284afbdc6830d84b33da03069073d4a.tar.gz rails-9ab290482284afbdc6830d84b33da03069073d4a.tar.bz2 rails-9ab290482284afbdc6830d84b33da03069073d4a.zip |
Fix `$rails_rake_task` global variable warning without replacing the value of $rails_rake_task if it is already set.
Fixes #4591.
Signed-off-by: José Valim <jose.valim@gmail.com>
-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 |