You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example obviously uses the ActiveRecord order method, but users could put anything appropriate to their ORM or data store in the block.
Internally, the gem would take the result of calling the relation name on the object and apply the block.
Right now, I can impose an order on the top-level collection, but the included relationships come out in whatever the database defaults to. This is a problem for me as I am using UUIDs as primary keys.
Furthermore, I don't want to impose the ordering on the relationship at the ORM level because I'll have to override that everywhere else in the application code.
Thoughts?
The text was updated successfully, but these errors were encountered:
Here's a proposal for an agnostic way of specifying how the serializer should sort the relationships specified by has_many.
This example obviously uses the ActiveRecord
order
method, but users could put anything appropriate to their ORM or data store in the block.Internally, the gem would take the result of calling the relation name on the object and apply the block.
Right now, I can impose an order on the top-level collection, but the
include
d relationships come out in whatever the database defaults to. This is a problem for me as I am using UUIDs as primary keys.Furthermore, I don't want to impose the ordering on the relationship at the ORM level because I'll have to override that everywhere else in the application code.
Thoughts?
The text was updated successfully, but these errors were encountered: