diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-20 12:43:03 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-20 12:43:03 -0700 |
commit | 3be9e8a0c2187744b6c9879ca2836cef5ebed693 (patch) | |
tree | e009c38c5efcbd4f88e9f420863de55e27052441 /actionpack/lib | |
parent | 4ed156336faaa378e0329f4e96c3f4c30ddaee09 (diff) | |
parent | 3ee6bcfc3d3e7be0dd3b76ac929500aaf031f8f9 (diff) | |
download | rails-3be9e8a0c2187744b6c9879ca2836cef5ebed693.tar.gz rails-3be9e8a0c2187744b6c9879ca2836cef5ebed693.tar.bz2 rails-3be9e8a0c2187744b6c9879ca2836cef5ebed693.zip |
Merge pull request #8002 from nashby/checkbox-include
check_box value can be not only an object of Array class
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/tags/check_box.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/check_box.rb b/actionpack/lib/action_view/helpers/tags/check_box.rb index 9d17a1dde3..e21cc07746 100644 --- a/actionpack/lib/action_view/helpers/tags/check_box.rb +++ b/actionpack/lib/action_view/helpers/tags/check_box.rb @@ -46,10 +46,12 @@ module ActionView false when String value == @checked_value - when Array - value.include?(@checked_value) else - value.to_i == @checked_value.to_i + if value.respond_to?(:include?) + value.include?(@checked_value) + else + value.to_i == @checked_value.to_i + end end end |