Skip to content
Browse files

only test `prefix` once

we don't need to repeat if statements
  • Loading branch information...
1 parent 318eea0 commit 91608dc342237372548ccbe403ef06c56c2755f2 @tenderlove tenderlove committed Aug 13, 2014
Showing with 4 additions and 2 deletions.
  1. +4 −2 actionpack/lib/action_dispatch/routing/mapper.rb
View
6 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -1732,12 +1732,14 @@ def prefix_name_for_action(as, action) #:nodoc:
elsif !canonical_action?(action, @scope[:scope_level])
prefix = action
end
- prefix.to_s.tr('-', '_') if prefix
+
+ if prefix
+ Mapper.normalize_name prefix.to_s.tr('-', '_')
+ end
end
def name_for_action(as, action) #:nodoc:
prefix = prefix_name_for_action(as, action)
- prefix = Mapper.normalize_name(prefix) if prefix
name_prefix = @scope[:as]
if parent_resource

0 comments on commit 91608dc

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