From 2f8643955a780f0c2fe46d0ae68db8d51b76fbbf Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 31 Dec 2009 11:57:48 -0800 Subject: Raise a helpful error if config.frameworks is used --- railties/lib/rails/configuration.rb | 7 +++++++ railties/test/application/configuration_test.rb | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index 12bf076f61..adb11e8257 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -119,6 +119,13 @@ module Rails end end + def frameworks(*args) + raise "config.frameworks in no longer supported. See the generated" \ + "config/boot.rb for steps on how to limit the frameworks that" \ + "will be loaded" + end + alias frameworks= frameworks + # Enable threaded mode. Allows concurrent requests to controller actions and # multiple database connections. Also disables automatic dependency loading # after boot, and disables reloading code on every request, as these are diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index a7df1e09ab..1f04eb9f75 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -100,5 +100,21 @@ module ApplicationTests assert !ActionController.autoload?(:RecordIdentifier) end + + test "runtime error is raised if config.frameworks= is used" do + add_to_config "config.frameworks = []" + + assert_raises RuntimeError do + require "#{app_path}/config/environment" + end + end + + test "runtime error is raised if config.frameworks is used" do + add_to_config "config.frameworks -= []" + + assert_raises RuntimeError do + require "#{app_path}/config/environment" + end + end end end -- cgit v1.2.3