diff options
author | Carl Lerche <carllerche@mac.com> | 2009-12-29 19:04:14 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2009-12-29 19:04:37 -0800 |
commit | e5c88434dbb7dc0690a474ae7c913453bf289328 (patch) | |
tree | d2a2b48a1c9351244b635e5de847ebe927c84534 | |
parent | 153ce2f3285a5dbaea66b3e97416e4476197489d (diff) | |
download | rails-e5c88434dbb7dc0690a474ae7c913453bf289328.tar.gz rails-e5c88434dbb7dc0690a474ae7c913453bf289328.tar.bz2 rails-e5c88434dbb7dc0690a474ae7c913453bf289328.zip |
Use the correct method for eager loading autoloads
-rw-r--r-- | railties/lib/rails/application.rb | 2 | ||||
-rw-r--r-- | railties/test/application/configuration_test.rb | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index d714c5ac41..5419b46f19 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -143,7 +143,7 @@ module Rails # Used by Passenger to ensure everything's loaded before forking and # to avoid autoload race conditions in JRuby. initializer :preload_frameworks do - ActiveSupport::Autoload.eager_load! if config.preload_frameworks + ActiveSupport::Autoload.eager_autoload! if config.preload_frameworks end initializer :initialize_cache do diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 4d9da525d7..ece41f9de8 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -83,5 +83,21 @@ module ApplicationTests require "#{app_path}/config/application" end end + + test "Frameworks are not preloaded by default" do + require "#{app_path}/config/environment" + + assert ActionController.autoload?(:RecordIdentifier) + end + + test "frameworks are preloaded with config.preload_frameworks is set" do + add_to_config <<-RUBY + config.preload_frameworks = true + RUBY + + require "#{app_path}/config/environment" + + assert !ActionController.autoload?(:RecordIdentifier) + end end end |