1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove deprecated ActionController::Metal.call

This commit is contained in:
Rafael Mendonça França 2017-01-03 21:11:14 -05:00
parent bf81a1cfd8
commit 836811d22d
No known key found for this signature in database
GPG key ID: FC23B6D0F1EEE948
3 changed files with 11 additions and 17 deletions

View file

@ -1,3 +1,7 @@
* Remove deprecated `ActionController::Metal.call`.
*Rafael Mendonça França*
* Remove deprecated `ActionController::Metal#env`.
*Rafael Mendonça França*

View file

@ -227,14 +227,6 @@ module ActionController
middleware_stack
end
# Makes the controller a Rack endpoint that runs the action in the given
# +env+'s +action_dispatch.request.path_parameters+ key.
def self.call(env)
req = ActionDispatch::Request.new env
action(req.path_parameters[:action]).call(env)
end
class << self; deprecate :call; end
# Returns a Rack endpoint for the given action name.
def self.action(name)
if middleware_stack.any?

View file

@ -238,7 +238,7 @@ module ActionDispatch
options[:controller] ||= /.+?/
end
if to.respond_to? :call
if to.respond_to?(:action) || to.respond_to?(:call)
options
else
to_endpoint = split_to to
@ -290,16 +290,14 @@ module ActionDispatch
end
def app(blocks)
if to.is_a?(Class) && to < ActionController::Metal
if to.respond_to?(:action)
Routing::RouteSet::StaticDispatcher.new to
elsif to.respond_to?(:call)
Constraints.new(to, blocks, Constraints::CALL)
elsif blocks.any?
Constraints.new(dispatcher(defaults.key?(:controller)), blocks, Constraints::SERVE)
else
if to.respond_to?(:call)
Constraints.new(to, blocks, Constraints::CALL)
elsif blocks.any?
Constraints.new(dispatcher(defaults.key?(:controller)), blocks, Constraints::SERVE)
else
dispatcher(defaults.key?(:controller))
end
dispatcher(defaults.key?(:controller))
end
end