From cf2a40b8ac372b81b2bb6d755705485ca51d2925 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 23 May 2014 16:29:06 -0700 Subject: Constraints contructor should always return a Constraints object I know, it's crazy. --- actionpack/lib/action_dispatch/routing/mapper.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 34790092f4..f39fd1ea35 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -16,14 +16,6 @@ module ActionDispatch :shallow, :blocks, :defaults, :options] class Constraints #:nodoc: - def self.new(app, constraints, request) - if constraints.any? - super(app, constraints, request) - else - app - end - end - attr_reader :app, :constraints def initialize(app, constraints, request) @@ -215,7 +207,11 @@ module ActionDispatch end def app - Constraints.new(endpoint, blocks, @set.request_class) + if blocks.any? + Constraints.new(endpoint, blocks, @set.request_class) + else + endpoint + end end def default_controller_and_action -- cgit v1.2.3