From 7b258f8e798ada9d681177ba6e0d1c9e60abbae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Wed, 28 Oct 2020 17:05:48 +0200 Subject: [PATCH] Don't force RegistrantUser name to be uppercase --- app/models/registrant_user.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index 40f48f69c..cb8212e17 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -57,7 +57,9 @@ class RegistrantUser < User def update_related_contacts cc, idcode = registrant_ident.split('-') - contacts = Contact.where(ident: idcode, country_code: cc).where('name != ?', username) + contacts = Contact.where(ident: idcode, country_code: cc) + .where('UPPER(name) != UPPER(?)', username) + contacts.each { |c| c.update(name: username) } end @@ -67,8 +69,8 @@ class RegistrantUser < User return false unless user_data[:first_name] return false unless user_data[:last_name] - user_data.each_value { |v| v.upcase! if v.is_a?(String) } user_data[:country_code] ||= 'EE' + %i[ident country_code].each { |f| user_data[f].upcase! if user_data[f].is_a?(String) } find_or_create_by_user_data(user_data) end