提交 4751a8c5 编写于 作者: A Aaron Patterson

Merge pull request #16504 from schneems/schneems/fix_url_for

Perf optimization for `url_for` called w/ Hash
...@@ -82,7 +82,9 @@ def url_for(options = nil) ...@@ -82,7 +82,9 @@ def url_for(options = nil)
when nil when nil
super({:only_path => true}) super({:only_path => true})
when Hash when Hash
super({ :only_path => options[:host].nil? }.merge!(options.symbolize_keys)) options = options.symbolize_keys
options[:only_path] = options[:host].nil? unless options.key?(:only_path)
super(options)
when :back when :back
_back_url _back_url
when Symbol when Symbol
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册