mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 23:42:04 +02:00
fixed codeclimate errors
This commit is contained in:
parent
f4e0084895
commit
e7e3278267
44 changed files with 118 additions and 150 deletions
|
@ -54,12 +54,8 @@ class WhiteIp < ApplicationRecord
|
|||
|
||||
def ids_including(ip)
|
||||
ipv4 = ipv6 = []
|
||||
if check_ip4(ip).present?
|
||||
ipv4 = select { |white_ip| check_ip4(white_ip.ipv4) === check_ip4(ip) }
|
||||
end
|
||||
if check_ip6(ip).present?
|
||||
ipv6 = select { |white_ip| check_ip6(white_ip.ipv6) === check_ip6(ip) }
|
||||
end
|
||||
ipv4 = select { |white_ip| check_ip4(white_ip.ipv4) === check_ip4(ip) } if check_ip4(ip).present?
|
||||
ipv6 = select { |white_ip| check_ip6(white_ip.ipv6) === check_ip6(ip) } if check_ip6(ip).present?
|
||||
(ipv4 + ipv6).pluck(:id).flatten.uniq
|
||||
end
|
||||
# rubocop:enable Style/CaseEquality
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue