diff options
author | Brian Rose <brian@heimidal.net> | 2011-12-20 13:19:55 -0700 |
---|---|---|
committer | Brian Rose <brian@heimidal.net> | 2011-12-20 13:26:10 -0700 |
commit | bd89946dd3ededc5850f1b9754cb39cf0331637a (patch) | |
tree | 06315682509d34fec7c72df3d9703c622b5c05ad /actionpack/lib | |
parent | cf2d31ab0b07e1c5b124209c85993df303c961f1 (diff) | |
download | rails-bd89946dd3ededc5850f1b9754cb39cf0331637a.tar.gz rails-bd89946dd3ededc5850f1b9754cb39cf0331637a.tar.bz2 rails-bd89946dd3ededc5850f1b9754cb39cf0331637a.zip |
Ensure option for select helper responds to `#first` before comparison.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index f895cad058..a8690430e5 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -584,7 +584,7 @@ module ActionView # [nil, []] # { nil => [] } # - if !choices.empty? && Array === choices.first.last + if !choices.empty? && choices.first.respond_to?(:first) && 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]) |