algoliasearch-rails
algoliasearch-rails copied to clipboard
Include ActiveModel::Serializer associations
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Related Issue | Fix #346 |
Need Doc update | no |
Describe your change
Calling the attributes
method on an instance of a ActiveModel::Serializer
class does not include associations. This fixes the issue by calling the as_json
method instead.
What problem is this fixing?
When using an ActiveModel Serializer to serialize your model, associations are not included.
I use AMS associations extensively -- thanks for doing this, I'd love to see this get merged!
hey @julienbourdeau - any chance you can review/approve this? It would help me & @ivancevich greatly!
Hi @yanismydj and @kyreeves! I will deal with this PR this week :) Thanks for pinging us
@chloelbn / @julienbourdeau any update on this?
Changing from reading only :attributes
to reading all relationships would be a breaking change. Do you see a way in which this would be an option to make it non-breaking? Thanks!