aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-11-25 02:21:57 -0800
committerYves Senn <yves.senn@gmail.com>2013-11-25 02:21:57 -0800
commitf4a5a9ea4d183f4102796215d4502c46dbe3e52b (patch)
treefaf4faee481a80676e7fff507b7e556719d91016 /actionview
parent7ccb482181ee6c47c765406009018a15172812de (diff)
parent0f2ef7b929de1a6892ea1f149a3f3e8d357268ae (diff)
downloadrails-f4a5a9ea4d183f4102796215d4502c46dbe3e52b.tar.gz
rails-f4a5a9ea4d183f4102796215d4502c46dbe3e52b.tar.bz2
rails-f4a5a9ea4d183f4102796215d4502c46dbe3e52b.zip
Merge pull request #13027 from akshay-vishnoi/f-refactor
avoiding calling of #option_value_selected? two times
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/helpers/form_options_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb
index 4347983bad..3e54d2daaa 100644
--- a/actionview/lib/action_view/helpers/form_options_helper.rb
+++ b/actionview/lib/action_view/helpers/form_options_helper.rb
@@ -361,7 +361,7 @@ module ActionView
text, value = option_text_and_value(element).map { |item| item.to_s }
html_attributes[:selected] = option_value_selected?(value, selected)
- html_attributes[:disabled] = disabled && option_value_selected?(value, disabled)
+ html_attributes[:disabled] = disabled && html_attributes[:selected]
html_attributes[:value] = value
content_tag_string(:option, text, html_attributes)