Add primary key indicator to model hover response #316
+77
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
![image](https://private-user-images.githubusercontent.com/14981592/319250993-a5227fd3-2afe-48c8-b087-2c1019f602d3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3NDA0MDksIm5iZiI6MTczOTc0MDEwOSwicGF0aCI6Ii8xNDk4MTU5Mi8zMTkyNTA5OTMtYTUyMjdmZDMtMmFmZS00OGM4LWIwODctMmMxMDE5ZjYwMmQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDIxMDgyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU2OGQ3YzllYmRmYzU5ZmY4OWQ3Nzg1MzljZmMwMDQwNmI3MTc4NzQ4ZjRlYTc4OWVmMGY4ZDRhOGIyNWYxNTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1hDugs_M9S9gfKAM0cPILxvBmC16CsR330l7nE2p8I8)
![image](https://private-user-images.githubusercontent.com/14981592/319251069-a36b4d82-bfb4-4a4b-9b6f-991362812778.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3NDA0MDksIm5iZiI6MTczOTc0MDEwOSwicGF0aCI6Ii8xNDk4MTU5Mi8zMTkyNTEwNjktYTM2YjRkODItYmZiNC00YTRiLTliNmYtOTkxMzYyODEyNzc4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDIxMDgyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY1YzVlMDZjNDg4MDJlYWI4MjUzN2YzODI2Zjk3NWZjZTAxZjU4OTllNTk5ZDhlZjk3MmE4NjY0OWZhZGVhZTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.RPOJGmNwelSHnmmW2Jae8tO3xpXKYKZPkt7AhiVqeD8)
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: