-
-
Notifications
You must be signed in to change notification settings - Fork 47
UniqueIndexChecker
Evgeniy Demin edited this page Nov 25, 2022
·
1 revision
Imagine your model has a unique index in the database but doesn't have validates :email, uniqueness: true
validation. In that case, you're sure that you won't have duplicated values in the database. But each attempt to save a duplicated value on that field will be rolled back with an error raised and without errors on your object. Mostly, you'd like to catch it properly and for that uniqueness-validator exists. This checker also supports a unique index on multiple columns (which should have a validates :email, uniqueness: { scope: :last_name }
validation).
If the project helps you or your organization, I would be very grateful if you contribute or donate. Your support is an incredible motivation and the biggest reward for my hard work.
- Home
- Installation
- How to run?
- Configuration
- Auto correction
- Integrations
- Checkers
- ColumnPresenceChecker
- LengthConstraintChecker
- NullConstraintChecker
- UniqueIndexChecker
- ForeignKeyChecker
- MissingUniqueIndexChecker
- MissingIndexChecker
- PrimaryKeyTypeChecker
- ForeignKeyTypeChecker
- RedundantIndexChecker
- RedundantUniqueIndexChecker
- EnumTypeChecker
- ForeignKeyCascadeChecker
- EnumValueChecker
- CaseSensitiveUniqueValidationChecker
- ThreeStateBooleanChecker
- MissingAssociationClassChecker
- MissingTableChecker
- ImplicitOrderingChecker
- FAQ
- Development