Include Enumerable to ArraySerializer

This commit is contained in:
Tema Bolshakov
2014-08-28 23:03:23 +04:00
parent 85b4b85bb3
commit 85ff8123fd
2 changed files with 5 additions and 8 deletions

View File

@@ -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