Add Rails/UniqueValidationWithoutIndex rule
This is something we should do everywhere because concurrent requests might bypass Rails uniqueness validations. However, since there are places where we aren't applying this rule and adding a unique index means we also need to destroy any hypothetical duplicate records, it's something we aren't going to solve right now. Therefore we use the "refactor" severity so existing offenses don't get in our way. In any case, we're adding the rule so we don't make the same mistake in the future.
This commit is contained in:
@@ -300,6 +300,10 @@ Rails/SkipsModelValidations:
|
|||||||
Rails/TimeZone:
|
Rails/TimeZone:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Rails/UniqueValidationWithoutIndex:
|
||||||
|
Enabled: true
|
||||||
|
Severity: refactor
|
||||||
|
|
||||||
Rails/UnknownEnv:
|
Rails/UnknownEnv:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Environments:
|
Environments:
|
||||||
|
|||||||
Reference in New Issue
Block a user