diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-07-31 11:25:01 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-07-31 11:25:01 -0700 |
commit | ed9b23d8986a2d4025913e7c56f353a579ab0189 (patch) | |
tree | 7155b5bb4ab79d096fc3d7dead1006e58dfbb0b7 | |
parent | 3e9158bb95de1770c5a529a903fe15b19a473439 (diff) | |
download | rails-ed9b23d8986a2d4025913e7c56f353a579ab0189.tar.gz rails-ed9b23d8986a2d4025913e7c56f353a579ab0189.tar.bz2 rails-ed9b23d8986a2d4025913e7c56f353a579ab0189.zip |
invert check so we fail faster
there's no reason to to_sym the string if it doesn't match the regexp
anyway
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 0e8badc498..5982dc862c 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1765,7 +1765,7 @@ module ActionDispatch # 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 |