From 5048b9309e22bb592af187cc01bd0d01147c144f Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Wed, 20 Apr 2016 14:04:54 +0300 Subject: [PATCH] Story#117991277 - allow to update country code if ident type is birthday --- app/models/epp/contact.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb index 52fef7143..ff119024d 100644 --- a/app/models/epp/contact.rb +++ b/app/models/epp/contact.rb @@ -173,6 +173,8 @@ class Epp::Contact < Contact elsif ident_type == "birthday" && !ident[/\A\d{4}-\d{2}-\d{2}\z/] && (Date.parse(ident) rescue false) at.merge!(ident: ident_frame.text) at.merge!(ident_country_code: ident_frame.attr('cc')) if ident_frame.attr('cc').present? + elsif ident_type == "birthday" && ident_country_code.blank? + at.merge!(ident_country_code: ident_frame.attr('cc')) elsif ident_type.blank? && ident_country_code.blank? at.merge!(ident_type: ident_frame.attr('type')) at.merge!(ident_country_code: ident_frame.attr('cc')) if ident_frame.attr('cc').present?