From caa54db8a000b537473f30bf6d64eead9154cbb7 Mon Sep 17 00:00:00 2001 From: Gosha Arinich Date: Thu, 10 Jan 2013 23:40:57 +0300 Subject: [PATCH] clearer conditional in constraint match check --- actionpack/lib/action_dispatch/routing/mapper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index a21383e09144f..1046a7d75a60c 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -26,9 +26,9 @@ def initialize(app, constraints, request) 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