Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of associations #221

Open
ClementParis016 opened this issue Oct 6, 2017 · 1 comment
Open

Order of associations #221

ClementParis016 opened this issue Oct 6, 2017 · 1 comment

Comments

@ClementParis016
Copy link

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.

@kevboutin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants