diff --git a/actionpack/lib/action_view/helpers/tags/check_box.rb b/actionpack/lib/action_view/helpers/tags/check_box.rb
index 9d17a1dde33f55b3eb95f3a007bac49adf21cb64..e21cc07746ba0e35613cd3a13c997d9f7f422715 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 @@ def checked?(value)
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
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index 246c4bfada330b39b95421c0dfa6fc15a7844a07..fbfc73deda27bde20d2c97d7f38d7c40ea0cf469 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -400,6 +400,12 @@ def test_check_box_checked_if_object_value_includes_checked_value
'',
check_box("post", "secret")
)
+
+ @post.secret = Set.new(['1'])
+ assert_dom_equal(
+ '',
+ check_box("post", "secret")
+ )
end
def test_check_box_with_include_hidden_false