aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/inspector.rb6
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb8
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb2
3 files changed, 7 insertions, 9 deletions
diff --git a/actionpack/lib/action_dispatch/routing/inspector.rb b/actionpack/lib/action_dispatch/routing/inspector.rb
index 2135b280da..4be49516bf 100644
--- a/actionpack/lib/action_dispatch/routing/inspector.rb
+++ b/actionpack/lib/action_dispatch/routing/inspector.rb
@@ -14,10 +14,10 @@ module ActionDispatch
def rack_app(app = self.app)
@rack_app ||= begin
+ app = app.app
class_name = app.class.name.to_s
- if class_name == "ActionDispatch::Routing::Mapper::Constraints"
- app.app
- elsif ActionDispatch::Routing::Redirect === app || class_name !~ /^ActionDispatch::Routing/
+
+ if ActionDispatch::Routing::Redirect === app || class_name !~ /^ActionDispatch::Routing/
app
end
end
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index b33c5e0dfd..c5e093dae5 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -216,10 +216,12 @@ module ActionDispatch
end
def app
+ endpoint = to.respond_to?(:call) ? to : dispatcher
+
if blocks.any?
Constraints.new(endpoint, blocks, @set.request_class)
else
- endpoint
+ Constraints.new(endpoint, blocks, @set.request_class)
end
end
@@ -306,10 +308,6 @@ module ActionDispatch
Journey::Router::Strexp.compile(path, requirements, SEPARATORS)
end
- def endpoint
- to.respond_to?(:call) ? to : dispatcher
- end
-
def dispatcher
Routing::RouteSet::Dispatcher.new(defaults)
end
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 924455bce2..f36453020f 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -704,7 +704,7 @@ module ActionDispatch
old_params = req.path_parameters
req.path_parameters = old_params.merge params
dispatcher = route.app
- if dispatcher.is_a?(Mapper::Constraints) && dispatcher.matches?(env)
+ if dispatcher.matches?(env)
dispatcher = dispatcher.app
end