mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Updated the options_for_select to deal with the fact that Strings now implement :first
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2126 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
9fdd453257
commit
3f14b1e94e
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ module ActionView
|
|||
container = container.to_a if Hash === container
|
||||
|
||||
options_for_select = container.inject([]) do |options, element|
|
||||
if element.respond_to?(:first) && element.respond_to?(:last)
|
||||
if element.is_a?(Array) || element.is_a?(Range)
|
||||
is_selected = ( (selected.respond_to?(:include?) ? selected.include?(element.last) : element.last == selected) )
|
||||
is_selected = ( (selected.respond_to?(:include?) && !selected.is_a?(String) ? selected.include?(element.last) : element.last == selected) )
|
||||
if is_selected
|
||||
|
|
Loading…
Reference in a new issue