aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/finisher.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-08-21 12:58:25 -0700
committerJosé Valim <jose.valim@plataformatec.com.br>2012-08-21 12:58:25 -0700
commit6bef1469d2e43d0815b70588370470983a4320af (patch)
tree7d1f2f5cc9506507e02cc13d2b6ff7f614a8ca88 /railties/lib/rails/application/finisher.rb
parent11e890fef8982caa206e4fbc033f896e6ad424a1 (diff)
parentda3d28ea33a7e418c99e89aa6b4028ba054f1f39 (diff)
downloadrails-6bef1469d2e43d0815b70588370470983a4320af.tar.gz
rails-6bef1469d2e43d0815b70588370470983a4320af.tar.bz2
rails-6bef1469d2e43d0815b70588370470983a4320af.zip
Merge pull request #7225 from rails/eager_load
Improve eager load on Rails
Diffstat (limited to 'railties/lib/rails/application/finisher.rb')
-rw-r--r--railties/lib/rails/application/finisher.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb
index 60aa40b92f..1952a0fc3a 100644
--- a/railties/lib/rails/application/finisher.rb
+++ b/railties/lib/rails/application/finisher.rb
@@ -50,9 +50,9 @@ module Rails
end
initializer :eager_load! do
- if config.cache_classes && !(defined?($rails_rake_task) && $rails_rake_task)
+ if config.eager_load
ActiveSupport.run_load_hooks(:before_eager_load, self)
- eager_load!
+ config.eager_load_namespaces.each(&:eager_load!)
end
end
@@ -91,7 +91,7 @@ module Rails
# Disable dependency loading during request cycle
initializer :disable_dependency_loading do
- if config.cache_classes && !config.dependency_loading
+ if config.eager_load
ActiveSupport::Dependencies.unhook!
end
end