fix: has_many through loses order_bys #178
Open
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.
Hi @benwilson512!
Thanks for all of your work in the community! ❤️
I think there is a small bug in
has_many throughassociations. They end up losingorder_bys.many_to_manyworks as expected. I was going to create an issue for this, but found this one #169.Seems like this commit may have caused it -> 37cd17f, but there seems to be some work around that time, maybe it was something else that did it.
In this PR:
has_many throughis no longer sortedPlease let me know if this makes sense to you. Dataloader is new to me, I'm trying to wrap my head around it.
The fix works as expected, there is already code that handles
distinctcorrectly (I ran into some errors with this in application code), so this could potentially be a way of fixing this.Note: This could totally be a me thing, not understanding how to use Dataloader correctly, but once I was able to create the failing tests it started to convince me.
Thank you