mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix $rails_rake_task
global variable warning without replacing the value of $rails_rake_task if it is already set.
Fixes #4591.
This commit is contained in:
parent
15a9b2c0d6
commit
1d9357df3b
1 changed files with 1 additions and 2 deletions
|
@ -2,7 +2,6 @@ module Rails
|
||||||
class Application
|
class Application
|
||||||
module Finisher
|
module Finisher
|
||||||
include Initializable
|
include Initializable
|
||||||
$rails_rake_task = nil
|
|
||||||
|
|
||||||
initializer :add_generator_templates do
|
initializer :add_generator_templates do
|
||||||
config.generators.templates.unshift(*paths["lib/templates"].existent)
|
config.generators.templates.unshift(*paths["lib/templates"].existent)
|
||||||
|
@ -49,7 +48,7 @@ module Rails
|
||||||
end
|
end
|
||||||
|
|
||||||
initializer :eager_load! do
|
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)
|
ActiveSupport.run_load_hooks(:before_eager_load, self)
|
||||||
eager_load!
|
eager_load!
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue