Permalink
Browse files

Raise a helpful error if config.frameworks is used

  • Loading branch information...
1 parent a23f4b6 commit 2f8643955a780f0c2fe46d0ae68db8d51b76fbbf Carl Lerche committed Dec 31, 2009
Showing with 23 additions and 0 deletions.
  1. +7 −0 railties/lib/rails/configuration.rb
  2. +16 −0 railties/test/application/configuration_test.rb
View
7 railties/lib/rails/configuration.rb
@@ -119,6 +119,13 @@ def paths
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
View
16 railties/test/application/configuration_test.rb
@@ -100,5 +100,21 @@ def setup
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

0 comments on commit 2f86439

Please sign in to comment.