diff options
author | Sam Pohlenz <sam@sampohlenz.com> | 2017-05-17 13:03:27 +0930 |
---|---|---|
committer | Sam Pohlenz <sam@sampohlenz.com> | 2017-05-17 13:03:27 +0930 |
commit | efe62b71d52c40849ead8855fb4f42fae91d4c54 (patch) | |
tree | 2f01c95c0b2c23e17f5945fb78efb3f86c4efe76 /actionview/lib/action_view | |
parent | 0714251b2d0d422dc3ffc852eeb604281195b0c2 (diff) | |
download | rails-efe62b71d52c40849ead8855fb4f42fae91d4c54.tar.gz rails-efe62b71d52c40849ead8855fb4f42fae91d4c54.tar.bz2 rails-efe62b71d52c40849ead8855fb4f42fae91d4c54.zip |
Fix select tag helper used with Enumerable choices
Allows a custom object implementing Enumerable to be used as the choices
parameter for a select tag, which previously wasn't possible due to the
call to `empty?` on the choices (which isn't implemented on Enumerable).
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/tags/select.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/tags/select.rb b/actionview/lib/action_view/helpers/tags/select.rb index 667c7e945a..9ff7e54e4f 100644 --- a/actionview/lib/action_view/helpers/tags/select.rb +++ b/actionview/lib/action_view/helpers/tags/select.rb @@ -33,7 +33,7 @@ module ActionView # [nil, []] # { nil => [] } def grouped_choices? - !@choices.empty? && @choices.first.respond_to?(:last) && Array === @choices.first.last + !@choices.blank? && @choices.first.respond_to?(:last) && Array === @choices.first.last end end end |