From a513cc1862cc61fd9605352a58c5e36cc40cb574 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sat, 11 Aug 2012 14:13:54 -0300 Subject: Ensure option_html_attributes does not modify the given option hashes We can avoid creating extra hashes with #merge, and use #merge! instead. --- actionpack/lib/action_view/helpers/form_options_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers') diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 775993fe03..e4f4ebc7ff 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -709,7 +709,7 @@ module ActionView private def option_html_attributes(element) if Array === element - element.select { |e| Hash === e }.reduce({}, :merge) + element.select { |e| Hash === e }.reduce({}, :merge!) else {} end -- cgit v1.2.3