Fix ordering HasOne fields without explicit order#2584
Fix ordering HasOne fields without explicit order#2584nickcharlton merged 1 commit intothoughtbot:mainfrom
Conversation
Ordering by a primary key of the HasOne field wasn't working and resulted in invalid sql, because it did not join the table. This unifies the code paths to use the same logic to add the ordering from another table and use reflection to get relevant table information.
|
@nickcharlton looks like even after #2498 approval is needed to run the workflow in a fork. Could I get approval from someone? |
|
I also encountered this problem. I tried this PR locally and it worked as expected 👍 |
Yeah, this is, unfortunately, expected behaviour. That PR allowed running at all, but then you need a maintainer (or equivalent, I don't remember the default roles off the top of my head) to approve them to run. The intention is to protect against data exfil, I think, or using lots of compute, maybe? It doesn't really apply to this project, so it's just another hurdle to have to jump over. |
|
@nickcharlton yeah, I understand. But can you approve it, so we can get a build and merge this fix? |
|
@nickcharlton Thank you very much! 🎉 |
This fixes a bug in awesome #2325.
Ordering by a primary key of the HasOne field wasn't working
and resulted in invalid sql, because it did not join the associated table.
This unifies the code paths to use the same logic to add the ordering
from another table and use reflection to get relevant table information.