Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added support for set collections

  • Loading branch information...
commit 63bfbd0133dc00c3a74cd1454b33dc688d128542 1 parent 8039826
@dwbutler authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/formtastic/inputs/check_boxes_input.rb
View
8 lib/formtastic/inputs/check_boxes_input.rb
@@ -177,7 +177,13 @@ def input_name
def make_selected_values
if object.respond_to?(method)
- selected_items = [object.send(method)].compact.flatten
+ selected_items = object.send(method)
+
+ if selected_items.respond_to?(:to_a)
+ selected_items = selected_items.to_a
+ end
+
+ selected_items = [selected_items].compact.flatten
[*selected_items.map { |o| send_or_call_or_object(value_method, o) }].compact
else
Please sign in to comment.
Something went wrong with that request. Please try again.