Check for CollectionProxy to detect has_many
Rails 4 returns an `ActiveRecord::Associations::CollectionProxy` instead of just an `Array` for has_many associations.master
parent
9e2a68d1ae
commit
2ba7f029cd
|
@ -64,7 +64,7 @@ module TheModerator
|
|||
objects = send(assoc)
|
||||
|
||||
if respond_to?("#{assoc}_attributes=")
|
||||
if objects.is_a?(Array)
|
||||
if objects.is_a?(Array) || objects.is_a?(ActiveRecord::Associations::CollectionProxy)
|
||||
data = moderate_has_many_association(objects, moderated_attributes)
|
||||
assoc_fields = data[:data]
|
||||
assoc_fields_display = data[:data_display]
|
||||
|
|
Loading…
Reference in New Issue