mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Bugfix: include nested has_many association
Currently, doing `include: author.bio` would work correctly, but not for has_many associations such as `include: author.roles`. This fixes it. The problem was basically that we were not handling arrays for has_many linked, as happens for ArraySerializers.
This commit is contained in:
@@ -16,6 +16,7 @@ module ActiveModel
|
||||
@second_post.author = @author
|
||||
@author.posts = [@first_post, @second_post]
|
||||
@author.bio = @bio
|
||||
@author.roles = []
|
||||
@bio.author = @author
|
||||
|
||||
@serializer = ArraySerializer.new([@first_post, @second_post])
|
||||
|
||||
Reference in New Issue
Block a user