提交 91608dc3 编写于 作者: A Aaron Patterson

only test `prefix` once

we don't need to repeat if statements
上级 318eea06
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册