Skip to content

Tolerate composite primary keys - #314

Draft
violet-graves wants to merge 2 commits into
mainfrom
violet-joe-issue-291
Draft

violet-graves wants to merge 2 commits into
mainfrom
violet-joe-issue-291

Conversation

@violet-graves

Copy link
Copy Markdown

partially closes #291

we still need to figure out how we want inspection to work

@jas14

jas14 commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

We discussed this in Slack, but just so we remember where we left off, a couple things:

Re: test failures, although Rails 7.0 went EOL in April 2025, if we can easily run the composite primary key tests only in Rails 7.1+, that would be a bit nicer for people than bumping the minimum to 7.1.

Re: inspection, I think it would look nicer to display the primary key fields sorted first and flattened, like so:

#<SuperDiff::Test::Models::ActiveRecord::Order store_id: 456, sku: "hi", details: nil, ...>

versus this, in which the keys and values aren't visually colocated:

#<SuperDiff::Test::Models::ActiveRecord::Order ["store_id", "sku"]: [456, "hi"], details: nil, ...>

Lastly, we're still emitting the primary key fields twice; we should only do that once.

This branch has not been deployed

No deployments
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.

Support ActiveRecord models with composite primary keys

2 participants