Skip to content

Commit

Permalink
Merge pull request #13027 from akshay-vishnoi/f-refactor
Browse files Browse the repository at this point in the history
avoiding calling of #option_value_selected? two times
  • Loading branch information
senny committed Nov 25, 2013
2 parents 7ccb482 + 0f2ef7b commit f4a5a9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionview/lib/action_view/helpers/form_options_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def options_for_select(container, selected = nil)
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)
Expand Down

0 comments on commit f4a5a9e

Please sign in to comment.