Permalink
Browse files

Merge pull request #16504 from schneems/schneems/fix_url_for

Perf optimization for `url_for` called w/ Hash
  • Loading branch information...
tenderlove committed Aug 14, 2014
2 parents c8ede23 + 4d47220 commit 4751a8c51ff4b9766dcf8324347477095b7f940d
Showing with 3 additions and 1 deletion.
  1. +3 −1 actionview/lib/action_view/routing_url_for.rb
@@ -82,7 +82,9 @@ def url_for(options = nil)
when nil
super({:only_path => true})
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
_back_url
when Symbol

0 comments on commit 4751a8c

Please sign in to comment.