提交 7f3cfb60 编写于 作者: A Aaron Patterson

always cast `name` to a symbol, and never to_s it

All callers of `action_path` interpolate the return value in to a
string, so there is no need for the method to to_s it.  to_sym on a
symbol will return the same symbol, though I think `action_path` may
always be called with a symbol so this might not be necessary.
上级 f727bd24
......@@ -1743,8 +1743,7 @@ def path_for_action(action, path) #:nodoc:
end
def action_path(name) #:nodoc:
name = name.to_sym if name.is_a?(String)
@scope[:path_names][name] || name.to_s
@scope[:path_names][name.to_sym] || name
end
def prefix_name_for_action(as, action) #:nodoc:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册