Skip to content

MissingUniqueIndexChecker

Evgeniy Demin edited this page Nov 25, 2022 · 1 revision

Imagine your model has a validates :email, uniqueness: true validation but has no unique index in the database. As a general problem, your validation can be skipped or there are possible duplicates inserted because of race conditions. To keep your data consistent you should cover your validation with a proper unique index in the database (if possible). It will ensure you don't have duplicates.

Clone this wiki locally