109012608-ip-split

This commit is contained in:
Stas 2015-11-27 15:00:16 +02:00
parent 1ac33f1df6
commit 0431543f77

View file

@ -172,11 +172,15 @@ namespace :import do
x.acl.all.each do |y|
next if existing_ips.include?(y.ipaddr)
if !y.ipaddr.nil? && y.ipaddr != ''
ips << WhiteIp.new({
registrar_id: Registrar.find_by(legacy_id: x.try(:id)).try(:id),
ipv4: y.ipaddr,
interfaces: ['api', 'registrar']
})
y.ipaddr.split(',').each do |ip|
ips << WhiteIp.new({
registrar_id: Registrar.find_by(legacy_id: x.try(:id)).try(:id),
ipv4: ip,
interfaces: ['api', 'registrar']
})
end
end
end
end