[FIX] Fetch json key from item serializer if empty collection is passed to collection serializer and each_searializer is specified.

This commit is contained in:
Roman Kapitonov
2016-02-24 21:03:36 +03:00
committed by Benjamin Fleischer
parent 33a0f9c806
commit 2dd0c33461
3 changed files with 29 additions and 4 deletions

View File

@@ -183,6 +183,12 @@ PaginatedSerializer = Class.new(ActiveModel::Serializer::CollectionSerializer) d
end
end
MessagesSerializer = Class.new(ActiveModel::Serializer) do
def json_key
'messages'
end
end
AlternateBlogSerializer = Class.new(ActiveModel::Serializer) do
attribute :id
attribute :name, key: :title