Skip to content

Conversation

@barnabasJ
Copy link
Contributor

@barnabasJ barnabasJ commented Nov 18, 2025

Test for this in ash-project/ash_postgres#654

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

lib/join.ex Outdated
query
end
end)
|> Ash.Query.unset([:distinct, :select, :limit, :offset])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need all three of these unset?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, my bad. I think i copied them together with an IO.inspect and only removed the inspect. Fixed now

|> Ash.Query.sort(relationship.sort)
else
Ash.Query.unset(query, :sort)
query
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I miss-interpreted what sort? stood for, fixed

@zachdaniel zachdaniel merged commit 90ce6b7 into main Nov 21, 2025
23 checks passed
@zachdaniel
Copy link
Contributor

🚀 Thank you for your contribution! 🚀

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

Successfully merging this pull request may close these issues.

3 participants