From 2f259982da9e1d22a80305c37e80fd529bf59ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Fri, 30 Oct 2020 11:51:20 +0200 Subject: [PATCH] Find related contacts via ident and ident_country_code --- app/models/registrant_user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index 420446582..f1e0e1c2d 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -55,7 +55,8 @@ class RegistrantUser < User end def update_related_contacts - contacts = Contact.where(ident: ident, country_code: country_code) + cc, idcode = registrant_ident.split('-') + contacts = Contact.where(ident: idcode, ident_country_code: cc) .where('UPPER(name) != UPPER(?)', username) contacts.each { |c| c.update(name: username) }