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

Check constraint support #104

Closed
azz opened this issue Apr 10, 2024 · 3 comments · Fixed by #105
Closed

Check constraint support #104

azz opened this issue Apr 10, 2024 · 3 comments · Fixed by #105

Comments

@azz
Copy link

azz commented Apr 10, 2024

Hey there. We currently use annotate_models, looking at maybe switching over, but it seems this fork does not support annotating check constraints. ctran/annotate_models#868

@drwl would you be keen to see a similar implementation here?

@drwl
Copy link
Owner

drwl commented Apr 10, 2024

@azz thanks for the issue! I added a PR, could you try building that version of the gem and tell me if it works and if you have any feedback?

@lparry
Copy link

lparry commented Apr 11, 2024

Hey @drwl, I'm a colleague of @azz, I've had a quick play switching from ctran/annotate_models to annotaterb just now and can confirm that the check constraint annotations appear to work correctly/the same as what we are used to.

There are some other unexpected changes unrelated to check constraints, but is probably down to config we just need to tweak. I will open an issue about the one that has me a bit stumped.

@drwl
Copy link
Owner

drwl commented Apr 11, 2024

@lparry thanks for taking the time to test it and providing feedback. I'm planning to add some unit tests and merging it in.

@drwl drwl closed this as completed in #105 Apr 12, 2024
drwl added a commit that referenced this issue Apr 12, 2024
Supports annotating model check constraints, credit goes to folks who
worked on ctran/annotate_models#868.

Adds new option `show_check_constraints` that defaults to `false`. When
enabled, it will add check constraints annotations
rails/rails#31323 to the model annotations.

It can be enabled also through the command line with options `-c` or
`--show-check-constraints`.

Resolves #104
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 a pull request may close this issue.

3 participants