From d6bcfd73f9cc425dd531817175739424c4eaf2fd Mon Sep 17 00:00:00 2001 From: Stas Date: Thu, 5 Nov 2015 13:31:09 +0200 Subject: [PATCH] Role added --- lib/tasks/import.rake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index d901ccf61..f92b859ec 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -148,6 +148,7 @@ namespace :import do password: x.acl.last.try(:password) ? x.acl.last.try(:password) : ('a'..'z').to_a.shuffle.first(8).join, identity_code: x.handle.try(:strip), registrar_id: Registrar.find_by(legacy_id: x.try(:id)).try(:id), + roles: ['super'], legacy_id: x.try(:id) }) elsif x.acl.last.try(:cert) == 'idkaart' @@ -160,7 +161,10 @@ namespace :import do end end + existing_ips = WhiteIp.pluck(:ipv4) + 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),