From eddf3234fb7d6a99e515ffaea2f45e6937d1c584 Mon Sep 17 00:00:00 2001 From: Stas Date: Mon, 30 Nov 2015 18:06:24 +0200 Subject: [PATCH] 109119896-name_org_exception --- lib/tasks/import.rake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 64aa9688c..1573848f1 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -250,7 +250,12 @@ namespace :import do next if existing_contact_ids.include?(x.id) count += 1 - name = x.name.try(:strip).presence || x.organization.try(:strip).presence + if 4 == x.ssntype + name = x.organization.try(:strip).presence || x.name.try(:strip).presence + else + name = x.name.try(:strip).presence || x.organization.try(:strip).presence + end + begin contacts << [ x.object_registry.name.try(:strip), @@ -262,7 +267,7 @@ namespace :import do x.ssn.try(:strip), ident_type_map[x.ssntype], x.object.authinfopw.try(:strip), - x.organization.try(:strip)? x.organization.try(:strip): name, + name, Registrar.find_by(legacy_id: x.object.try(:clid)).try(:id), x.object_registry.try(:registrar).try(:name), x.object.try(:registrar).try(:name) ? x.object.try(:registrar).try(:name) : x.object_registry.try(:registrar).try(:name),