Skip to content

Commit

Permalink
Merge pull request rails#8882 from goshakkk/clearer-conditional
Browse files Browse the repository at this point in the history
Clearer conditional in constraint match check
  • Loading branch information
carlosantoniodasilva committed Jan 11, 2013
2 parents fc6f5a4 + caa54db commit d61b49e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actionpack/lib/action_dispatch/routing/mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d61b49e

Please sign in to comment.