Take into account address_processing setting when creating and updating the contact via EPP

#251
This commit is contained in:
Artur Beljajev 2016-12-14 00:38:20 +02:00
parent a77a0ae558
commit d3b1a23e92
11 changed files with 311 additions and 164 deletions

View file

@ -37,7 +37,8 @@ class Contact < ActiveRecord::Base
validate :val_ident_type
validate :val_ident_valid_format?
validate :validate_html
validate :val_country_code
validate :validate_country_code
validate :validate_ident_country_code
after_initialize do
self.status_notes = {} if status_notes.nil?
@ -417,9 +418,13 @@ class Contact < ActiveRecord::Base
self.country_code = country_code.upcase if country_code
end
def val_country_code
def validate_country_code
return unless country_code
errors.add(:country_code, :invalid) unless Country.new(country_code)
end
def validate_ident_country_code
errors.add(:ident, :invalid_country_code) unless Country.new(ident_country_code)
errors.add(:ident, :invalid_country_code) unless Country.new(country_code)
end
def related_domain_descriptions