mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Stub out comments writer when needed
This commit is contained in:
committed by
Santiago Pastorino
parent
ceded40aa1
commit
e2b7bba626
@@ -53,6 +53,10 @@ module ActiveModel
|
||||
@post1 = Post.new({ title: 'Title 1', body: 'Body 1', date: '1/1/2000' })
|
||||
@post2 = Post.new({ title: 'Title 2', body: 'Body 2', date: '1/1/2000' })
|
||||
|
||||
class << @post2
|
||||
attr_writer :comments
|
||||
end
|
||||
|
||||
@post2.comments = [
|
||||
Comment.new(content: 'C3'),
|
||||
Comment.new(content: 'C4')
|
||||
|
||||
Reference in New Issue
Block a user