diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-23 16:29:06 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-23 16:29:06 -0700 |
commit | cf2a40b8ac372b81b2bb6d755705485ca51d2925 (patch) | |
tree | 8bfebf66e9fb4dcd5b82b7cc575fad8aa399f538 /actionpack/lib | |
parent | 2b7b136e0a01f8beb19d31571934db5a98774c87 (diff) | |
download | rails-cf2a40b8ac372b81b2bb6d755705485ca51d2925.tar.gz rails-cf2a40b8ac372b81b2bb6d755705485ca51d2925.tar.bz2 rails-cf2a40b8ac372b81b2bb6d755705485ca51d2925.zip |
Constraints contructor should always return a Constraints object
I know, it's crazy.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 14 |
1 files 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 |