Skip to content

Commit

Permalink
refactor Routing::Mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
goshacmd committed Jan 3, 2013
1 parent ef61504 commit 77f2ba9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions actionpack/lib/action_dispatch/routing/mapper.rb
Expand Up @@ -26,15 +26,10 @@ def initialize(app, constraints, request)
def matches?(env)
req = @request.new(env)

@constraints.each { |constraint|
if constraint.respond_to?(:matches?) && !constraint.matches?(req)
return false
elsif constraint.respond_to?(:call) && !constraint.call(*constraint_args(constraint, req))
return false
end
}

return true
@constraints.none? do |constraint|
(constraint.respond_to?(:matches?) && !constraint.matches?(req)) ||
(constraint.respond_to?(:call) && !constraint.call(*constraint_args(constraint, req)))
end
ensure
req.reset_parameters
end
Expand Down

1 comment on commit 77f2ba9

@batiste
Copy link

@batiste batiste commented on 77f2ba9 Jun 2, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit changed the behaviour somehow. We use to have nil constraints that returned true (a config) and now with this nil returns false.

Please sign in to comment.