mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Check IP in registrar
This commit is contained in:
parent
19e133ec6a
commit
940355a417
4 changed files with 33 additions and 2 deletions
|
@ -24,4 +24,17 @@ class WhiteIp < ActiveRecord::Base
|
|||
scope :repp, -> { where(interface: REPP) }
|
||||
scope :registrar, -> { where(interface: REGISTRAR) }
|
||||
scope :global, -> { where(interface: GLOBAL) }
|
||||
|
||||
class << self
|
||||
def registrar_ip_white?(ip)
|
||||
at = WhiteIp.arel_table
|
||||
WhiteIp.where(
|
||||
at[:interface].eq(REGISTRAR).or(
|
||||
at[:interface].eq(GLOBAL)
|
||||
).and(
|
||||
at[:ipv4].eq(ip)
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue