mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Support overriding association methods
You can override associations to define custom scope on them.
This commit is contained in:
@@ -14,6 +14,8 @@ module ActiveModel
|
||||
@post.author = @author
|
||||
@first_comment.post = @post
|
||||
@second_comment.post = @post
|
||||
@blog = Blog.new(id: 1, name: "My Blog!!")
|
||||
@post.blog = @blog
|
||||
|
||||
@serializer = PostSerializer.new(@post)
|
||||
@adapter = ActiveModel::Serializer::Adapter::Json.new(@serializer)
|
||||
|
||||
Reference in New Issue
Block a user