From caa54db8a000b537473f30bf6d64eead9154cbb7 Mon Sep 17 00:00:00 2001 From: Gosha Arinich Date: Thu, 10 Jan 2013 23:40:57 +0300 Subject: clearer conditional in constraint match check --- actionpack/lib/action_dispatch/routing/mapper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index a21383e091..1046a7d75a 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -26,9 +26,9 @@ module ActionDispatch def matches?(env) req = @request.new(env) - @constraints.none? do |constraint| - (constraint.respond_to?(:matches?) && !constraint.matches?(req)) || - (constraint.respond_to?(:call) && !constraint.call(*constraint_args(constraint, req))) + @constraints.all? do |constraint| + (constraint.respond_to?(:matches?) && constraint.matches?(req)) || + (constraint.respond_to?(:call) && constraint.call(*constraint_args(constraint, req))) end ensure req.reset_parameters -- cgit v1.2.3