Skip to content

JSON adapter does not handle nested associations #835

Closed
@frahugo

Description

It only supports the associations in the model being serialized. For instance if you serialize Blog, it will serialize the posts, but not the comments of each post.

This line https://github.com/rails-api/active_model_serializers/blob/master/lib/active_model/serializer/adapter/json.rb#L14 should probably be changed to get a serializable_hash instead of just attributes.

This was discovered while trying existing 0.9.x code on the master branch. Is this something that should be supported? If so, I can submit a pull request for it.

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions