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
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