Check for response to #last instead of #first.

This commit is contained in:
Brian Rose
2011-12-20 13:38:16 -07:00
parent bd89946dd3
commit a1b2dbd7d4

View File

@@ -584,7 +584,7 @@ module ActionView
# [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])