mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Move the original config method onto AbstractController
This commit is contained in:
parent
b160663bd1
commit
1f0f05b10c
4 changed files with 10 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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 a new issue