aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2009-12-23 19:00:20 -0800
committerCarlhuda <carlhuda@engineyard.com>2009-12-23 19:00:20 -0800
commitaf5c3c852e43fc95b4c4344f61c9c8fc2210b0ca (patch)
treef39fbe682a47fd01152025d09790ee4257aa9bbc
parent9653599a798b66fe19b70cd8ed33b3d344b26883 (diff)
downloadrails-af5c3c852e43fc95b4c4344f61c9c8fc2210b0ca.tar.gz
rails-af5c3c852e43fc95b4c4344f61c9c8fc2210b0ca.tar.bz2
rails-af5c3c852e43fc95b4c4344f61c9c8fc2210b0ca.zip
Require active_support/all unless specifically requested to be left out.
-rw-r--r--railties/lib/rails/application.rb4
-rw-r--r--railties/test/application/configuration_test.rb6
2 files changed, 10 insertions, 0 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 8ba24af793..711509738d 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -132,6 +132,10 @@ module Rails
@app.call(env)
end
+ initializer :load_all_active_support do
+ require "active_support/all" unless config.active_support.bare
+ end
+
# Set the <tt>$LOAD_PATH</tt> based on the value of
# Configuration#load_paths. Duplicates are removed.
initializer :set_load_path do
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 0f702c7014..e71b4c0cdb 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -46,6 +46,12 @@ module ApplicationTests
end
end
+ test "if there's no config.active_support.bare, all of ActiveSupport is required" do
+ use_frameworks []
+ require "#{app_path}/config/environment"
+ assert_nothing_raised { [1,2,3].rand }
+ end
+
test "config.active_support.bare does not require all of ActiveSupport" do
add_to_config "config.active_support.bare = true"