respect read action sort if relationship does not specify one#194
Merged
zachdaniel merged 3 commits intomainfrom Nov 21, 2025
Merged
respect read action sort if relationship does not specify one#194zachdaniel merged 3 commits intomainfrom
zachdaniel merged 3 commits intomainfrom
Conversation
6 tasks
zachdaniel
reviewed
Nov 19, 2025
| query | ||
| end | ||
| end) | ||
| |> Ash.Query.unset([:distinct, :select, :limit, :offset]) |
Contributor
There was a problem hiding this comment.
Do we need all three of these unset?
Contributor
Author
There was a problem hiding this comment.
No, my bad. I think i copied them together with an IO.inspect and only removed the inspect. Fixed now
zachdaniel
reviewed
Nov 19, 2025
| |> Ash.Query.sort(relationship.sort) | ||
| else | ||
| Ash.Query.unset(query, :sort) | ||
| query |
Contributor
There was a problem hiding this comment.
sort? being false means that we aren't in a situation where sorting should happen at all (like exists/2. I think you want to always unset the sort, and then set the sort to relationship.sort || query.sort, and if sort? is false then you just unset it so we don't sort for no reason.
Contributor
Author
There was a problem hiding this comment.
ok, I miss-interpreted what sort? stood for, fixed
zachdaniel
approved these changes
Nov 21, 2025
zachdaniel
approved these changes
Nov 21, 2025
Contributor
|
🚀 Thank you for your contribution! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test for this in ash-project/ash_postgres#654
Contributor checklist
Leave anything that you believe does not apply unchecked.