From 61579b76616d06ccb8268411421c23fb612e5113 Mon Sep 17 00:00:00 2001 From: Andrew Kaspick Date: Thu, 11 Aug 2011 13:28:31 -0500 Subject: when calling url_for with a hash, additional (likely unwanted) values (such as :host) would be returned in the hash... calling #dup on the hash prevents this --- actionpack/lib/action_dispatch/routing/url_for.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/routing') diff --git a/actionpack/lib/action_dispatch/routing/url_for.rb b/actionpack/lib/action_dispatch/routing/url_for.rb index 480144fe9d..5d354b0fb8 100644 --- a/actionpack/lib/action_dispatch/routing/url_for.rb +++ b/actionpack/lib/action_dispatch/routing/url_for.rb @@ -140,7 +140,7 @@ module ActionDispatch when String options when nil, Hash - _routes.url_for((options || {}).reverse_merge!(url_options).symbolize_keys) + _routes.url_for((options.dup || {}).reverse_merge!(url_options).symbolize_keys) else polymorphic_url(options) end -- cgit v1.2.3