Replace contact name with org when name is empty

This commit is contained in:
Martin Lensment 2015-04-07 10:29:50 +03:00
parent 7f04f2e2fe
commit e64622b372

View file

@ -148,6 +148,7 @@ namespace :import do
next if existing_contact_ids.include?(x.id)
count += 1
name = x.name.try(:strip).presence || x.organization.try(:strip).presence
begin
contacts << [
x.object_registry.name.try(:strip),
@ -158,7 +159,7 @@ namespace :import do
x.ssn.try(:strip),
ident_type_map[x.ssntype],
x.object.authinfopw.try(:strip),
x.name.try(:strip),
name,
x.organization.try(:strip),
x.object_registry.try(:registrar).try(:id),
user,