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

Add primary key indicator to model hover response #316

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

Earlopain
Copy link
Contributor

Closes #313

Rails 7.1 supports composite primary keys so the return type will either be a string or an array of strings, depending on the pk type. I've added a test for that case.

I was a bit surprised that the tests don't go through resolve_database_info_from_model. I guess because it would involve the runner and require db setup? Anyways, I tested it manually and this is what it looks like:
image
image

@Earlopain Earlopain requested a review from a team as a code owner April 3, 2024 15:29
@Earlopain Earlopain requested review from andyw8 and st0012 April 3, 2024 15:29
@andyw8
Copy link
Contributor

andyw8 commented Apr 3, 2024

I was a bit surprised that the tests don't go through resolve_database_info_from_model.

You're right, we've been meaning to re-work this: #317

Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@vinistock vinistock merged commit 8c0e73a into Shopify:main Apr 10, 2024
28 checks passed
@Earlopain Earlopain deleted the schema-pk-indicator branch April 10, 2024 20:14
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.

Indicate primary key in schema hover
4 participants