Add some failing tests around has_many assocs...

..where no serializer is defined for the thing that is has_many'd
This commit is contained in:
Justin Aiken
2015-06-12 15:05:33 -06:00
committed by João Moura
parent 189b79523c
commit 3710c32cee
4 changed files with 31 additions and 1 deletions

View File

@@ -76,6 +76,7 @@ Role = Class.new(Model)
User = Class.new(Model)
Location = Class.new(Model)
Place = Class.new(Model)
Tag = Class.new(Model)
Comment = Class.new(Model) do
# Uses a custom non-time-based cache key
def cache_key
@@ -224,6 +225,12 @@ PostPreviewSerializer = Class.new(ActiveModel::Serializer) do
belongs_to :author, serializer: AuthorPreviewSerializer
end
PostWithTagsSerializer = Class.new(ActiveModel::Serializer) do
attributes :id
has_many :tags
end
Spam::UnrelatedLinkSerializer = Class.new(ActiveModel::Serializer) do
attributes :id
end