0
0
Fork 0

Add admin API for managing IP blocks (#19065)

This commit is contained in:
Eugen Rochko 2022-08-27 20:56:47 +02:00 committed by GitHub
parent ff19dad5a0
commit b399d79545
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 120 additions and 1 deletions

View file

@ -16,6 +16,7 @@ class IpBlock < ApplicationRecord
CACHE_KEY = 'blocked_ips'
include Expireable
include Paginable
enum severity: {
sign_up_requires_approval: 5000,
@ -28,7 +29,7 @@ class IpBlock < ApplicationRecord
after_commit :reset_cache
def to_log_human_identifier
"#{record.ip}/#{record.ip.prefix}"
"#{ip}/#{ip.prefix}"
end
class << self