From 5e056ed954045e595b8a32ffd3c4a98743b64c9c Mon Sep 17 00:00:00 2001 From: olegphenomenon Date: Mon, 25 Oct 2021 15:15:28 +0300 Subject: [PATCH] added another breakpoints --- .../api/v1/registrant/contacts_controller.rb | 44 ++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/v1/registrant/contacts_controller.rb b/app/controllers/api/v1/registrant/contacts_controller.rb index 2dda1619c..e1ed02181 100644 --- a/app/controllers/api/v1/registrant/contacts_controller.rb +++ b/app/controllers/api/v1/registrant/contacts_controller.rb @@ -102,12 +102,46 @@ module Api ident_type: 'priv', ident_country_code: country) return contact if contact - company_register = CompanyRegister::Client.new - res = company_register.representation_rights(citizen_personal_code: company_codes, - citizen_country_code: current_registrant_user.country.alpha3) - p "++++++++++++++++" - p res + # company_register = CompanyRegister::Client.new + # res = company_register.representation_rights(citizen_personal_code: company_codes, + # citizen_country_code: current_registrant_user.country.alpha3) + # p "++++++++++++++++" + # p res + # p "+++++++++++++++++" + # res.each do |r| + # unless contact.name == r.company_ame + # contact.update(name: r.company_name) + # end + # p "+++++++++++++++++" + p "+++++++++++++++++" + p current_registrant_user.companies + p "+++++++++++++++++" + p "+++++++++++++++++" + p "+++++++++++++++++" + p company_codes + p "+++++++++++++++++" + p "+++++++++++++++++" + p "+++++++++++++++++" + + + current_registrant_user.companies.each do |i| + c = Contact.find_by(uuid: uuid, ident_type: 'org', ident: company_codes, + ident_country_code: country) + + p "+++++++++++++++++" + p "+++++++++++++++++" + p c.org_name + p "+++++++++++++++++" + p "+++++++++++++++++" + p i.company_name + p "+++++++++++++++++" + p "+++++++++++++++++" + + unless c.org_name == i.company_name + c.update(org_name: company_name) + end + end Contact.find_by(uuid: uuid, ident_type: 'org', ident: company_codes, ident_country_code: country)