Permalink
Browse files

Check for response to `#last` instead of `#first`.

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 55334f5 commit d2abe28ed342443f8c374a6e02977ccb0c3b3f95 @heimidal heimidal committed with josevalim Dec 20, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -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])

0 comments on commit d2abe28

Please sign in to comment.