diff options
author | José Valim <jose.valim@gmail.com> | 2010-04-22 12:00:13 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-22 12:00:13 +0200 |
commit | 4163ccec2343ee66e2488f067eab2a15260e1219 (patch) | |
tree | 70213bd4d187c88b2fd0bbf05a54eed7ec3a49f7 /actionpack/lib/abstract_controller/base.rb | |
parent | a8330c2006e90a6da8f621fdaf1156fa63b4049a (diff) | |
download | rails-4163ccec2343ee66e2488f067eab2a15260e1219.tar.gz rails-4163ccec2343ee66e2488f067eab2a15260e1219.tar.bz2 rails-4163ccec2343ee66e2488f067eab2a15260e1219.zip |
Clean up the config object in ActionPack. Create config_accessor which just delegates to the config object, reducing the number of deprecations and add specific tests.
Diffstat (limited to 'actionpack/lib/abstract_controller/base.rb')
-rw-r--r-- | actionpack/lib/abstract_controller/base.rb | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb index c12b584144..8500cbd7f2 100644 --- a/actionpack/lib/abstract_controller/base.rb +++ b/actionpack/lib/abstract_controller/base.rb @@ -1,4 +1,4 @@ -require 'active_support/ordered_options' +require 'active_support/configurable' module AbstractController class Error < StandardError; end @@ -8,6 +8,8 @@ module AbstractController attr_internal :response_body attr_internal :action_name + include ActiveSupport::Configurable + class << self attr_reader :abstract alias_method :abstract?, :abstract @@ -29,14 +31,6 @@ module AbstractController @descendants ||= [] end - def config - @config ||= ActiveSupport::InheritableOptions.new(superclass < Base ? superclass.config : {}) - end - - def configure - yield 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 @@ -99,10 +93,6 @@ module AbstractController abstract! - def config - @config ||= ActiveSupport::InheritableOptions.new(self.class.config) - end - # Calls the action going through the entire action dispatch stack. # # The actual method that is called is determined by calling @@ -133,6 +123,7 @@ module AbstractController end private + # Returns true if the name can be considered an action. This can # be overridden in subclasses to modify the semantics of what # can be considered an action. |