fotinakis / jsonapi-serializers

Pure Ruby readonly serializers for the JSON:API spec.
MIT License
413 stars 91 forks source link

Options on associations should be respected #132

Closed lewisf closed 1 year ago

lewisf commented 4 years ago

Please let me know if this makes sense and anything else I would need to do.

I mostly did this to support

  has_many :related_objects, include_data: true, serializer: MyCustomSerializer

Where I wanted to override the Serializer in the case where related_objects is a list of ActiveRecord STI objects but I wanted to use a single serializer for all of them.

Was it intentional that related objects use top level options (@options) and ignore inline options when using find_serializer?