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 ActiveRecord validations to mirror table NOT NULL constraint #859

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

tmaier
Copy link
Contributor

@tmaier tmaier commented Mar 15, 2024

This is a minor thing in my opinion.

I use active_record_doctor to identify potential database issues or risks.

When I run $ bin/rake active_record_doctor after I added flipper-active_record, I received the following recommendations:

add a `presence` validator to Flipper::Adapters::ActiveRecord::Gate.feature_key - it's NOT NULL but lacks a validator
add a `presence` validator to Flipper::Adapters::ActiveRecord::Gate.key - it's NOT NULL but lacks a validator
add a `presence` validator to Flipper::Adapters::ActiveRecord::Feature.key - it's NOT NULL but lacks a validator

Ref. https://github.com/gregnavis/active_record_doctor?tab=readme-ov-file#detecting-missing-presence-validations

This pull request adds these validators.

@bkeepers bkeepers merged commit 4d416c4 into flippercloud:main Mar 15, 2024
36 checks passed
@bkeepers
Copy link
Collaborator

Thanks @tmaier!

@tmaier tmaier deleted the patch-1 branch March 16, 2024 00:22
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.

None yet

2 participants