aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-01-17 23:05:18 -0200
committerPrem Sichanugrist <s@sikachu.com>2012-04-27 18:34:20 -0400
commit7006e975ac29e48cb9645733df04b9841bb2c29d (patch)
tree97c406055e4a4aa9d60948a728ff0dcd0217c5aa /actionpack/lib/action_view
parent05bee990b4bd0ce3b02e75399c857e168f41edb6 (diff)
downloadrails-7006e975ac29e48cb9645733df04b9841bb2c29d.tar.gz
rails-7006e975ac29e48cb9645733df04b9841bb2c29d.tar.bz2
rails-7006e975ac29e48cb9645733df04b9841bb2c29d.zip
Do not mutate options hash
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/record_tag_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/record_tag_helper.rb b/actionpack/lib/action_view/helpers/record_tag_helper.rb
index b351302d01..aae6389445 100644
--- a/actionpack/lib/action_view/helpers/record_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/record_tag_helper.rb
@@ -96,8 +96,8 @@ module ActionView
# for each record.
def content_tag_for_single_record(tag_name, record, prefix, options, &block)
options, prefix = prefix, nil if prefix.is_a?(Hash)
- options ||= {}
- options.merge!({ :class => "#{dom_class(record, prefix)} #{options[:class]}".strip, :id => dom_id(record, prefix) })
+ options = options ? options.dup : {}
+ options.merge!(:class => "#{dom_class(record, prefix)} #{options[:class]}".strip, :id => dom_id(record, prefix))
if block.arity == 0
content_tag(tag_name, capture(&block), options)
else