Permalink
Browse files

Use .find here as it is simpler and faster.

  • Loading branch information...
1 parent 1a2b28c commit 5704aa2e1ad6889aed772f1a60c59c030e24e2f8 @josevalim josevalim committed Sep 30, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -1087,7 +1087,7 @@ def name_for_action(as, action)
end
candidate = name.select(&:present?).join("_").presence
- candidate unless as.nil? && @set.routes.map(&:name).include?(candidate)
+ candidate unless as.nil? && @set.routes.find { |r| r.name == candidate }
end
end

0 comments on commit 5704aa2

Please sign in to comment.