-
-
Notifications
You must be signed in to change notification settings - Fork 857
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
Fixes issue for ordering by a relationship. #1926
base: 8.0
Are you sure you want to change the base?
Conversation
* | ||
* @param array $selects | ||
*/ | ||
public function applySelects(array $selects) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use protected function
. Thanks!
The PR looks good and tests are passing. Will check this asap. BTW, if possible, can you add a test for this scenario? Thanks! 🍻 |
@Nathanw I just realized after testing this that allowing sort on Duplicate records when sorted via User -> HasMany-> Post On the other hand, I think it does fix sorting on HasMany relationship. Do you think we should merge this and allow the unnecessary duplicate results? Any feedbacks from other users? |
@yajra Almost every relation cause duplicate results. It's always correct to Nowadays I always include I feel like this should be merged and |
This fixes an issue when ordering by a
HasMany
relationship due to no selects being on the query and overriding the original models id with the id from the relationship.