mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Replace contact name with org when name is empty
This commit is contained in:
parent
7f04f2e2fe
commit
e64622b372
1 changed files with 8 additions and 7 deletions
|
@ -23,30 +23,30 @@ namespace :import do
|
||||||
# in console: Legacy::Contact.last
|
# in console: Legacy::Contact.last
|
||||||
# in console: exit
|
# in console: exit
|
||||||
#
|
#
|
||||||
# In console you should get Last Legacy::Contact object.
|
# In console you should get Last Legacy::Contact object.
|
||||||
# If you get any errors, scroll up and read first lines
|
# If you get any errors, scroll up and read first lines
|
||||||
# to figure out what went wrong to connect to fred database.
|
# to figure out what went wrong to connect to fred database.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# 2) START IMPORT
|
# 2) START IMPORT
|
||||||
# ---------------
|
# ---------------
|
||||||
#
|
#
|
||||||
# Import scrip does not write anything to fred database.
|
# Import scrip does not write anything to fred database.
|
||||||
# Script is implemented this way, you can run it multiple times
|
# Script is implemented this way, you can run it multiple times
|
||||||
# in case you need it. However already imported object are
|
# in case you need it. However already imported object are
|
||||||
# not reimported, thus if some object has been updated meanwhile
|
# not reimported, thus if some object has been updated meanwhile
|
||||||
# in fred database, those updates will be missed and thous should
|
# in fred database, those updates will be missed and thous should
|
||||||
# be carried over manually. All new object in fred will be
|
# be carried over manually. All new object in fred will be
|
||||||
# imported in multiple import script runs.
|
# imported in multiple import script runs.
|
||||||
#
|
#
|
||||||
# Start all import:
|
# Start all import:
|
||||||
#
|
#
|
||||||
# cd your_registry_deploy_path/current/
|
# cd your_registry_deploy_path/current/
|
||||||
# RAILS_ENV=production bundle exec rails import:all
|
# RAILS_ENV=production bundle exec rails import:all
|
||||||
#
|
#
|
||||||
# If you wish to import one by one, please follow individual import order
|
# If you wish to import one by one, please follow individual import order
|
||||||
# from task 'Import all' tasks in this script.
|
# from task 'Import all' tasks in this script.
|
||||||
|
|
||||||
desc 'Import all'
|
desc 'Import all'
|
||||||
task all: :environment do
|
task all: :environment do
|
||||||
Rake::Task['import:registrars'].invoke
|
Rake::Task['import:registrars'].invoke
|
||||||
|
@ -148,6 +148,7 @@ namespace :import do
|
||||||
next if existing_contact_ids.include?(x.id)
|
next if existing_contact_ids.include?(x.id)
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
|
name = x.name.try(:strip).presence || x.organization.try(:strip).presence
|
||||||
begin
|
begin
|
||||||
contacts << [
|
contacts << [
|
||||||
x.object_registry.name.try(:strip),
|
x.object_registry.name.try(:strip),
|
||||||
|
@ -158,7 +159,7 @@ namespace :import do
|
||||||
x.ssn.try(:strip),
|
x.ssn.try(:strip),
|
||||||
ident_type_map[x.ssntype],
|
ident_type_map[x.ssntype],
|
||||||
x.object.authinfopw.try(:strip),
|
x.object.authinfopw.try(:strip),
|
||||||
x.name.try(:strip),
|
name,
|
||||||
x.organization.try(:strip),
|
x.organization.try(:strip),
|
||||||
x.object_registry.try(:registrar).try(:id),
|
x.object_registry.try(:registrar).try(:id),
|
||||||
user,
|
user,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue