mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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>
This commit is contained in:
committed by
José Valim
parent
d5dde3734b
commit
9ab2904822
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user