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

Clean up old composite key code #49265

Merged
merged 1 commit into from Sep 15, 2023
Merged

Conversation

gmcgibbon
Copy link
Member

Motivation / Background

This Pull Request has been created because there's some old code that can be cleaned up related to composite primary key handling.

Detail

This Pull Request changes Active Record to lean on tuple query syntax to reduce logical branches in code. Because where now supports tuple querying, we don't need to manually build queries with where and or statements.

Additional information

This is just cleanup for an unreleased feature, so I think we can lean on existing tests and changelogs for CPK.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Copy link
Contributor

@nvasilevski nvasilevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

My only worry was that we may accidentally start building relations like where([:id] => [[1], [2]) which results in a series of OR clauses instead of IN (1,2) statement but it's going to happen in the areas we are touching.

Because where now supports tuple querying, we don't need to manually
build queries with where and or statements.
@gmcgibbon gmcgibbon merged commit ed9248d into rails:main Sep 15, 2023
4 checks passed
@gmcgibbon gmcgibbon deleted the cpk_tuple_or_querying branch September 15, 2023 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants