mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
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:
7
test/fixtures/poro.rb
vendored
7
test/fixtures/poro.rb
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user