From f8566b0fbdcfaaab16e657c3df13dfa9399973e4 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Fri, 29 Jan 2021 11:55:35 +0100 Subject: [PATCH] use correct format for role_name. #697 --- app/models/contact.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index a27369b4e..c3f99ff1f 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -133,7 +133,7 @@ def self.import_from_providers provider_id: provider.uid, given_name: provider.voting_contact_given_name, family_name: provider.voting_contact_family_name, - role_name: (Array.wrap(contact.role_name.underscore) << "voting").uniq) + role_name: (Array.wrap(contact.role_name) << "voting").uniq) puts "Imported voting contact #{contact.email} for provider #{provider.symbol}." else puts "Error importing voting contact #{contact.email} for provider #{provider.symbol}: #{contact.errors.messages.inspect}." @@ -146,7 +146,7 @@ def self.import_from_providers provider_id: provider.uid, given_name: provider.billing_contact_given_name, family_name: provider.billing_contact_family_name, - role_name: (Array.wrap(contact.role_name.underscore) << "billing").uniq) + role_name: (Array.wrap(contact.role_name) << "billing").uniq) puts "Imported billing contact #{contact.email} for provider #{provider.symbol}." else puts "Error importing billing contact #{contact.email} for provider #{provider.symbol}: #{contact.errors.messages.inspect}." @@ -159,7 +159,7 @@ def self.import_from_providers provider_id: provider.uid, given_name: provider.secondary_billing_contact_given_name, family_name: provider.secondary_billing_contact_family_name, - role_name: (Array.wrap(contact.role_name.underscore) << "secondaryBilling").uniq) + role_name: (Array.wrap(contact.role_name) << "secondary_billing").uniq) puts "Imported secondary billing contact #{contact.email} for provider #{provider.symbol}." else puts "Error importing secondary technical contact #{contact.email} for provider #{provider.symbol}: #{contact.errors.messages.inspect}." @@ -172,7 +172,7 @@ def self.import_from_providers provider_id: provider.uid, given_name: provider.service_contact_given_name, family_name: provider.service_contact_family_name, - role_name: (Array.wrap(contact.role_name.underscore) << "service").uniq) + role_name: (Array.wrap(contact.role_name) << "service").uniq) puts "Imported service contact #{contact.email} for provider #{provider.symbol}." else puts "Error importing service contact #{contact.email} for provider #{provider.symbol}: #{contact.errors.messages.inspect}." @@ -185,7 +185,7 @@ def self.import_from_providers provider_id: provider.uid, given_name: provider.secondary_service_contact_given_name, family_name: provider.secondary_service_contact_family_name, - role_name: (Array.wrap(contact.role_name.underscore) << "secondaryService").uniq) + role_name: (Array.wrap(contact.role_name) << "secondary_service").uniq) puts "Imported secondary service contact #{contact.email} for provider #{provider.symbol}." else puts "Error importing secondary service contact #{contact.email} for provider #{provider.symbol}: #{contact.errors.messages.inspect}." @@ -198,7 +198,7 @@ def self.import_from_providers provider_id: provider.uid, given_name: provider.technical_contact_given_name, family_name: provider.technical_contact_family_name, - role_name: (Array.wrap(contact.role_name.underscore) << "technical").uniq) + role_name: (Array.wrap(contact.role_name) << "technical").uniq) puts "Imported technical contact #{contact.email} for provider #{provider.symbol}." else puts "Error importing technical contact #{contact.email} for provider #{provider.symbol}: #{contact.errors.messages.inspect}." @@ -211,7 +211,7 @@ def self.import_from_providers provider_id: provider.uid, given_name: provider.secondary_technical_contact_given_name, family_name: provider.secondary_technical_contact_family_name, - role_name: (Array.wrap(contact.role_name.underscore) << "secondaryTechnical").uniq) + role_name: (Array.wrap(contact.role_name) << "secondary_technical").uniq) puts "Imported secondary technical contact #{contact.email} for provider #{provider.symbol}." else puts "Error importing secondary technical contact #{contact.email} for provider #{provider.symbol}: #{contact.errors.messages.inspect}."