Move the original config method onto AbstractController
This commit is contained in:
parent
b160663bd1
commit
1f0f05b10c
@ -28,6 +28,10 @@ def descendants
|
||||
@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 @@ def initialize #:nodoc:
|
||||
@_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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user