diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-08-11 14:13:54 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-08-11 14:17:01 -0300 |
commit | a513cc1862cc61fd9605352a58c5e36cc40cb574 (patch) | |
tree | 3206b4cf54ffcfb7c0800d6f2ba6b1315b12d6fc /actionpack/lib/action_view/helpers/form_options_helper.rb | |
parent | e8e8617c390776e6d7b21ca79b99503a8afb19ae (diff) | |
download | rails-a513cc1862cc61fd9605352a58c5e36cc40cb574.tar.gz rails-a513cc1862cc61fd9605352a58c5e36cc40cb574.tar.bz2 rails-a513cc1862cc61fd9605352a58c5e36cc40cb574.zip |
Ensure option_html_attributes does not modify the given option hashes
We can avoid creating extra hashes with #merge, and use #merge! instead.
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_options_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |