ranked-model
ranked-model copied to clipboard
With position
This adds a class method
Duck.rank(:swimming_order).with_swimming_order_position
It is meant to be used when serializing a collection with its order. It sets the swimming_order_position
of each item in the array. The only drawbacks are that you cannot chain queries after it (it returns an array, not an ActiveRecord object), and that it does the ordering in ruby (not SQL), and that It also won't paginate super nicely (this gem doesn't really do that anyway, so that's fine). Also, I couldn't get the tests running locally, so I didn't add any. Feel free to add some.
This should solve https://github.com/mixonic/ranked-model/issues/70, https://github.com/mixonic/ranked-model/issues/116, https://github.com/mixonic/ranked-model/issues/10
@zlotnika Thanks I was lookin for this
@mixonic Any plan to accept this PR?
Closing due to inactivity and no tests.