Move the original config method onto AbstractController

This commit is contained in:
Carl Lerche 2010-03-03 19:45:08 -08:00
parent b160663bd1
commit 1f0f05b10c
4 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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