diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-01-11 03:21:51 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-01-11 03:21:51 -0800 |
commit | d61b49e178991d9dcf7afe561d5543586d86c97c (patch) | |
tree | e7d34d2df5e9babb5a6cce56d531f979aa75e59a /actionpack | |
parent | fc6f5a43df06bd3ecc9e77706da4dc833dafe726 (diff) | |
parent | caa54db8a000b537473f30bf6d64eead9154cbb7 (diff) | |
download | rails-d61b49e178991d9dcf7afe561d5543586d86c97c.tar.gz rails-d61b49e178991d9dcf7afe561d5543586d86c97c.tar.bz2 rails-d61b49e178991d9dcf7afe561d5543586d86c97c.zip |
Merge pull request #8882 from goshakkk/clearer-conditional
Clearer conditional in constraint match check
Diffstat (limited to 'actionpack')
-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 |