mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Merge branch 'postalinfo'
Conflicts: app/helpers/epp/contacts_helper.rb app/models/address.rb app/models/contact.rb db/schema.rb spec/epp/contact_spec.rb spec/fabricators/contact_fabricator.rb spec/fabricators/international_address_fabricator.rb spec/models/address_spec.rb spec/models/contact_spec.rb
This commit is contained in:
commit
8d5152d400
17 changed files with 343 additions and 195 deletions
|
@ -49,9 +49,12 @@ module Epp::ContactsHelper
|
|||
@ph = params_hash['epp']['command']['create']['create']
|
||||
xml_attrs_present?(@ph, [['id'],
|
||||
%w(authInfo pw),
|
||||
%w(postalInfo name),
|
||||
%w(postalInfo addr city),
|
||||
%w(postalInfo addr cc)])
|
||||
%w(postalInfo)])
|
||||
if @ph['postalInfo'].is_a?(Hash) || @ph['postalInfo'].is_a?(Array)
|
||||
xml_nested_attrs_present?( @ph['postalInfo'], [ %w(name),
|
||||
%w(addr city),
|
||||
%w(addr cc)])
|
||||
end
|
||||
end
|
||||
|
||||
## UPDATE
|
||||
|
@ -102,12 +105,14 @@ module Epp::ContactsHelper
|
|||
case type
|
||||
when :update
|
||||
contact_hash = Contact.extract_attributes(@ph[:chg], type)
|
||||
contact_hash[:address_attributes] =
|
||||
Address.extract_attributes(( @ph.try(:[], :chg).try(:[], :postalInfo).try(:[], :addr) || []), type)
|
||||
contact_hash = contact_hash.merge(
|
||||
Address.extract_attributes(( @ph.try(:[], :chg).try(:[], :postalInfo) || [] ), type)
|
||||
)
|
||||
else
|
||||
contact_hash = Contact.extract_attributes(@ph, type)
|
||||
contact_hash[:address_attributes] =
|
||||
Address.extract_attributes(( @ph.try(:[], :postalInfo).try(:[], :addr) || []), type)
|
||||
contact_hash = contact_hash.merge(
|
||||
Address.extract_attributes(( @ph.try(:[], :postalInfo) || [] ), type)
|
||||
)
|
||||
end
|
||||
contact_hash[:ident_type] = ident_type unless ident_type.nil?
|
||||
contact_hash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue