about summary refs log tree commit diff
path: root/app/models/ip_block.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-10-25 21:43:44 +0200
committerGitHub <noreply@github.com>2022-10-25 21:43:44 +0200
commit487d81fb92350974e20ee220553a10b5229f0880 (patch)
tree00ad8445858c85ef56e2e2d2fc08b29c522d0d60 /app/models/ip_block.rb
parent6f01111863bfb15b3574c95c8d60d59ae1d79772 (diff)
Fix IP blocks not having a unique index (#19456)
Diffstat (limited to 'app/models/ip_block.rb')
-rw-r--r--app/models/ip_block.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/ip_block.rb b/app/models/ip_block.rb
index 8666f4248..31343f0e1 100644
--- a/app/models/ip_block.rb
+++ b/app/models/ip_block.rb
@@ -25,6 +25,7 @@ class IpBlock < ApplicationRecord
   }
 
   validates :ip, :severity, presence: true
+  validates :ip, uniqueness: true
 
   after_commit :reset_cache