Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the correct foreign key when sorting belongs_to associations #1552

Merged
merged 2 commits into from Feb 18, 2020

Conversation

pablobm
Copy link
Collaborator

@pablobm pablobm commented Feb 13, 2020

Administrate::Order makes the assumption that a relation's foreign key will be #{relation_name}_id, when instead it could be anything.

This currently breaks our demo site, if you go to the customers list and try to order by country. This is as described by #1182

@nickcharlton
Copy link
Member

Nice, thanks! I'll merge this.

@nickcharlton nickcharlton merged commit 990896c into thoughtbot:master Feb 18, 2020
@pablobm pablobm deleted the correct-order-key branch June 24, 2021 10:30
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.

None yet

2 participants