epilogue icon indicating copy to clipboard operation
epilogue copied to clipboard

Order of associations

Open ClementParis016 opened this issue 7 years ago • 1 comments

If I have a Discussion model plugged to a Message model through an hasMany relationship, how should I proceed to retrieve a specific discussion with its messages sorted in a particular order?

Setting a defaultScope with an { order: [['createdAt', 'DESC]] } on the Message model doesn't work, and setting sort: { default: '-createdAt' } in the message ressource doesn't work either.

ClementParis016 avatar Oct 06 '17 13:10 ClementParis016

Looks like I created the same sort of issue here: https://github.com/dchester/epilogue/issues/235

I did however provide an example, which may help demonstrate the issue better.

kevboutin avatar Oct 04 '18 15:10 kevboutin