Skip to content

Commit

Permalink
Check for response to #last instead of #first.
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
Brian Rose authored and josevalim committed Dec 20, 2011
1 parent 55334f5 commit d2abe28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/form_options_helper.rb
Expand Up @@ -584,7 +584,7 @@ def to_select_tag(choices, options, html_options)
# [nil, []]
# { nil => [] }
#
if !choices.empty? && choices.first.respond_to?(:first) && Array === choices.first.last
if !choices.empty? && choices.first.respond_to?(:last) && Array === choices.first.last
option_tags = grouped_options_for_select(choices, :selected => selected_value, :disabled => options[:disabled])
else
option_tags = options_for_select(choices, :selected => selected_value, :disabled => options[:disabled])
Expand Down

0 comments on commit d2abe28

Please sign in to comment.