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

fix: Support ActiveRecord 7.1 composite primary keys #686

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

BytewaveMLP
Copy link
Contributor

ActiveRecord 7.1 added first-party support for composite primary keys, which changed the way the primary_key method behaves; specifically, in cases where a model or table has a composite primary key, this will return an array of attributes rather than just one.

Given this gem already has support for composite primary keys through the composite_primary_keys gem, I just extracted out the work done there to support Rails 7.1's approach.

Closes #685.

@BytewaveMLP BytewaveMLP force-pushed the fix-rails-71-composite-primary-key branch from 3df32cc to 9b1104d Compare October 13, 2023 14:38
@flyerhzm flyerhzm merged commit 33b0c25 into flyerhzm:main Oct 13, 2023
10 checks passed
@BytewaveMLP BytewaveMLP deleted the fix-rails-71-composite-primary-key branch October 13, 2023 18:35
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.

Rails 7.1 composite primary keys break N+1 detection
2 participants