Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

invert check so we fail faster

there's no reason to to_sym the string if it doesn't match the regexp
anyway
  • Loading branch information...
commit ed9b23d8986a2d4025913e7c56f353a579ab0189 1 parent 3e9158b
@tenderlove tenderlove authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  actionpack/lib/action_dispatch/routing/mapper.rb
View
2  actionpack/lib/action_dispatch/routing/mapper.rb
@@ -1765,7 +1765,7 @@ def name_for_action(as, action) #:nodoc:
# and return nil in case it isn't. Otherwise, we pass the invalid name
# forward so the underlying router engine treats it and raises an exception.
if as.nil?
- candidate unless @set.named_routes.key?(candidate) || candidate !~ /\A[_a-z]/i
+ candidate unless candidate !~ /\A[_a-z]/i || @set.named_routes.key?(candidate)
else
candidate
end

0 comments on commit ed9b23d

Please sign in to comment.
Something went wrong with that request. Please try again.