This is not a bug, but it feels like it could provide benefits for very little effort to expose wether or not the record is part of a collection in the serializer.
Benefits include being able to conditionally filter out a costly has_many when in a collection context out of the box.
I know this could be done by either specifying a different serializer for my endpoints serving collection, or passing a custom params hash for every endpoint, but I really see no reason to do so when the information needed already lives inside the scope of serializable_hash.
Expected Behavior
Have access in serializer to wether or not the record is part of a collection.
Actual Behavior
There is no way to know if the record is part of a collection or not.
This is not a bug, but it feels like it could provide benefits for very little effort to expose wether or not the record is part of a collection in the serializer.
Benefits include being able to conditionally filter out a costly has_many when in a collection context out of the box.
I know this could be done by either specifying a different serializer for my endpoints serving collection, or passing a custom params hash for every endpoint, but I really see no reason to do so when the information needed already lives inside the scope of serializable_hash.
Expected Behavior
Have access in serializer to wether or not the record is part of a collection.
Actual Behavior
There is no way to know if the record is part of a collection or not.