0
0
Fork 0

Fix IP blocks not having a unique index (#19456)

This commit is contained in:
Eugen Rochko 2022-10-25 21:43:44 +02:00 committed by GitHub
parent 6f01111863
commit 487d81fb92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 2 deletions

View file

@ -25,6 +25,7 @@ class IpBlock < ApplicationRecord
}
validates :ip, :severity, presence: true
validates :ip, uniqueness: true
after_commit :reset_cache