Permalink
Browse files

Merge pull request #8882 from goshakkk/clearer-conditional

Clearer conditional in constraint match check
  • Loading branch information...
carlosantoniodasilva committed Jan 11, 2013
2 parents fc6f5a4 + caa54db commit d61b49e178991d9dcf7afe561d5543586d86c97c
Showing with 3 additions and 3 deletions.
  1. +3 −3 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

0 comments on commit d61b49e

Please sign in to comment.