diff options
author | Gosha Arinich <me@goshakkk.name> | 2013-01-10 23:40:57 +0300 |
---|---|---|
committer | Gosha Arinich <me@goshakkk.name> | 2013-01-10 23:40:57 +0300 |
commit | caa54db8a000b537473f30bf6d64eead9154cbb7 (patch) | |
tree | 2779f39e504adb0cd7531ba1bf2615d32bc29888 | |
parent | 34126fa6e38b0010856d3ec8af04bdcfd9dde662 (diff) | |
download | rails-caa54db8a000b537473f30bf6d64eead9154cbb7.tar.gz rails-caa54db8a000b537473f30bf6d64eead9154cbb7.tar.bz2 rails-caa54db8a000b537473f30bf6d64eead9154cbb7.zip |
clearer conditional in constraint match check
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 6 |
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 |