Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix `$rails_rake_task` global variable warning without replacing the …

…value of $rails_rake_task if it is already set.

Fixes #4591.
  • Loading branch information...
commit 1d9357df3b30a3aa5a2418b0fe68aeacbb111500 1 parent 15a9b2c
@jviney jviney authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  railties/lib/rails/application/finisher.rb
View
3  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 Finisher
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
Please sign in to comment.
Something went wrong with that request. Please try again.