Skip to content

Fix ordering by custom primary key in has_many associations#3007

Open
goosys wants to merge 2 commits intothoughtbot:mainfrom
goosys:fix/group_column
Open

Fix ordering by custom primary key in has_many associations#3007
goosys wants to merge 2 commits intothoughtbot:mainfrom
goosys:fix/group_column

Conversation

@goosys
Copy link
Copy Markdown
Contributor

@goosys goosys commented Mar 19, 2026

Please review this PR after the other PR is merged:
The diff is here.

I fixed has_many ordering because group_by was using a fixed column :id.
Also, when grouping is not possible, sorting is now skipped to avoid duplicate records.

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.

1 participant