Permalink
Browse files

Simplify merge call on polymorphic helpers

  • Loading branch information...
1 parent 0b2eee4 commit e2ae787b36e32627974a0d448694c0067327fed7 @carlosantoniodasilva carlosantoniodasilva committed May 13, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
View
4 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
@@ -102,7 +102,7 @@ module PolymorphicRoutes
#
def polymorphic_url(record_or_hash_or_array, options = {})
if Hash === record_or_hash_or_array
- options = record_or_hash_or_array.dup.merge!(options)
+ options = record_or_hash_or_array.merge(options)
record = options.delete :id
return polymorphic_url record, options
end
@@ -123,7 +123,7 @@ def polymorphic_url(record_or_hash_or_array, options = {})
# <tt>polymorphic_url</tt> with <tt>routing_type: :path</tt>.
def polymorphic_path(record_or_hash_or_array, options = {})
if Hash === record_or_hash_or_array
- options = record_or_hash_or_array.dup.merge!(options)
+ options = record_or_hash_or_array.merge(options)
record = options.delete :id
return polymorphic_path record, options
end

0 comments on commit e2ae787

Please sign in to comment.