diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2012-08-21 12:58:25 -0700 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2012-08-21 12:58:25 -0700 |
commit | 6bef1469d2e43d0815b70588370470983a4320af (patch) | |
tree | 7d1f2f5cc9506507e02cc13d2b6ff7f614a8ca88 /railties/lib/rails/application/finisher.rb | |
parent | 11e890fef8982caa206e4fbc033f896e6ad424a1 (diff) | |
parent | da3d28ea33a7e418c99e89aa6b4028ba054f1f39 (diff) | |
download | rails-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.rb | 6 |
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 |