mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
@@ -130,7 +130,7 @@ module ActiveModel
|
||||
@association.embed_in_root = true
|
||||
@association.serializer_class = Class.new(ActiveModel::Serializer) do
|
||||
def content
|
||||
'fake'
|
||||
object.read_attribute_for_serialization(:content) + '!'
|
||||
end
|
||||
|
||||
attributes :content
|
||||
@@ -138,7 +138,7 @@ module ActiveModel
|
||||
|
||||
assert_equal({
|
||||
'post' => { title: 'Title 1', body: 'Body 1', 'comment_ids' => @post.comments.map { |c| c.object_id } },
|
||||
comments: [{ content: 'fake' }, { content: 'fake' }]
|
||||
comments: [{ content: 'C1!' }, { content: 'C2!' }]
|
||||
}, @post_serializer.as_json)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user