diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-01-03 21:11:14 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-01-03 21:12:15 -0500 |
commit | 836811d22dc2f6000cf3d08c493525a710e63069 (patch) | |
tree | b08cdc3b0a47a2adc6bd353d45613165dcb8510d /actionpack/lib/action_dispatch/routing | |
parent | bf81a1cfd80191ef144d8fc30783804565bb844e (diff) | |
download | rails-836811d22dc2f6000cf3d08c493525a710e63069.tar.gz rails-836811d22dc2f6000cf3d08c493525a710e63069.tar.bz2 rails-836811d22dc2f6000cf3d08c493525a710e63069.zip |
Remove deprecated ActionController::Metal.call
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 089aa9f78e..83652bd34c 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -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 |