mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Check for response to #last instead of #first.
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user