aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-03-03 19:45:08 -0800
committerCarl Lerche <carllerche@mac.com>2010-03-03 21:24:27 -0800
commit1f0f05b10c924d2f0d0ff4c74cbd979e77deea1d (patch)
tree34121d202d4d176944b26d51aec84edaaecf0286 /actionpack
parentb160663bd13d08bf845bc8cdf87a2c5e7e46f901 (diff)
downloadrails-1f0f05b10c924d2f0d0ff4c74cbd979e77deea1d.tar.gz
rails-1f0f05b10c924d2f0d0ff4c74cbd979e77deea1d.tar.bz2
rails-1f0f05b10c924d2f0d0ff4c74cbd979e77deea1d.zip
Move the original config method onto AbstractController
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/abstract_controller/base.rb8
-rw-r--r--actionpack/lib/action_controller/metal.rb8
-rw-r--r--actionpack/test/abstract_unit.rb2
-rw-r--r--actionpack/test/template/asset_tag_helper_test.rb2
4 files changed, 10 insertions, 10 deletions
diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb
index e14818e464..cbd021e246 100644
--- a/actionpack/lib/abstract_controller/base.rb
+++ b/actionpack/lib/abstract_controller/base.rb
@@ -28,6 +28,10 @@ module AbstractController
@descendants ||= []
end
+ def config
+ @config ||= ActiveSupport::InheritableOptions.new(superclass < Base ? superclass.config : {})
+ end
+
# A list of all internal methods for a controller. This finds the first
# abstract superclass of a controller, and gets a list of all public
# instance methods on that abstract class. Public instance methods of
@@ -95,6 +99,10 @@ module AbstractController
@_formats = nil
end
+ def config
+ self.class.config
+ end
+
# Calls the action going through the entire action dispatch stack.
#
# The actual method that is called is determined by calling
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb
index 1f6bbeb7c5..4374ab0a6b 100644
--- a/actionpack/lib/action_controller/metal.rb
+++ b/actionpack/lib/action_controller/metal.rb
@@ -11,14 +11,6 @@ module ActionController
class Metal < AbstractController::Base
abstract!
- def self.config
- @config ||= ActiveSupport::InheritableOptions.new(superclass < Metal ? superclass.config : {})
- end
-
- def config
- self.class.config
- end
-
# :api: public
attr_internal :params, :env
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 7223a7824e..29270ed228 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -109,7 +109,7 @@ class BasicController
attr_accessor :request
def config
- @config ||= ActiveSupport::InheritableOptions.new(ActionController::Metal.config).tap do |config|
+ @config ||= ActiveSupport::InheritableOptions.new(ActionController::Base.config).tap do |config|
# VIEW TODO: View tests should not require a controller
public_dir = File.expand_path("../fixtures/public", __FILE__)
config.assets_dir = public_dir
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index 8b24f66a6e..bbfab05a0f 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -5,7 +5,7 @@ class FakeController
attr_accessor :request
def config
- @config ||= ActiveSupport::InheritableOptions.new(ActionController::Metal.config)
+ @config ||= ActiveSupport::InheritableOptions.new(ActionController::Base.config)
end
end