aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
diff options
context:
space:
mode:
authorGosha Arinich <me@goshakkk.name>2013-01-10 23:40:57 +0300
committerGosha Arinich <me@goshakkk.name>2013-01-10 23:40:57 +0300
commitcaa54db8a000b537473f30bf6d64eead9154cbb7 (patch)
tree2779f39e504adb0cd7531ba1bf2615d32bc29888 /actionpack/lib/action_dispatch/routing
parent34126fa6e38b0010856d3ec8af04bdcfd9dde662 (diff)
downloadrails-caa54db8a000b537473f30bf6d64eead9154cbb7.tar.gz
rails-caa54db8a000b537473f30bf6d64eead9154cbb7.tar.bz2
rails-caa54db8a000b537473f30bf6d64eead9154cbb7.zip
clearer conditional in constraint match check
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb6
1 files changed, 3 insertions, 3 deletions
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