mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Include Enumerable to ArraySerializer
This commit is contained in:
@@ -8,9 +8,7 @@ module ActiveModel
|
||||
associations = serializer.associations(only: [:id]).each_with_object({}) do |(attr, value), h|
|
||||
h[attr] = case value
|
||||
when ActiveModel::Serializer::ArraySerializer
|
||||
value.attributes(options).map do |item|
|
||||
item.id
|
||||
end.to_a
|
||||
value.map(&:id)
|
||||
when ActiveModel::Serializer
|
||||
# process belongs_to association
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user