Skip to content

Commit

Permalink
Use serializer to resolve attribute or relation from either itself or…
Browse files Browse the repository at this point in the history
… the serialized object
  • Loading branch information
Pelle ten Cate committed Apr 2, 2019
1 parent 1cbdb50 commit b604247
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/caprese/serializer/concerns/relationships.rb
Expand Up @@ -105,7 +105,10 @@ def build_association_block(reflection_name)
end
end

serializer.relationship_scope(reflection_name, object.send(object.class.caprese_unalias_field(name)))
serializer.relationship_scope(
reflection_name,
serializer.read_attribute_for_serialization(object.class.caprese_unalias_field(name))
)
end
end

Expand Down

0 comments on commit b604247

Please sign in to comment.