diff --git a/app/helpers/registration_helper.rb b/app/helpers/registration_helper.rb index ef5462ac887..bee90b84ed5 100644 --- a/app/helpers/registration_helper.rb +++ b/app/helpers/registration_helper.rb @@ -16,6 +16,6 @@ module RegistrationHelper end def ip_blocked?(remote_ip) - IpBlock.where(severity: :sign_up_block).exists?(['ip >>= ?', remote_ip.to_s]) + IpBlock.severity_sign_up_block.exists?(['ip >>= ?', remote_ip.to_s]) end end diff --git a/app/models/ip_block.rb b/app/models/ip_block.rb index d6242efbf7d..f9e68f2e443 100644 --- a/app/models/ip_block.rb +++ b/app/models/ip_block.rb @@ -36,7 +36,7 @@ class IpBlock < ApplicationRecord class << self def blocked?(remote_ip) - blocked_ips_map = Rails.cache.fetch(CACHE_KEY) { FastIpMap.new(IpBlock.where(severity: :no_access).pluck(:ip)) } + blocked_ips_map = Rails.cache.fetch(CACHE_KEY) { FastIpMap.new(severity_no_access.pluck(:ip)) } blocked_ips_map.include?(remote_ip) end end