mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
Added multiple streets to address
This commit is contained in:
parent
dc2ec5535f
commit
e8ddf2272e
5 changed files with 20 additions and 14 deletions
|
@ -120,7 +120,9 @@ module Epp::ContactsHelper
|
|||
contact_hash = contact_hash.merge({
|
||||
address_attributes: {
|
||||
country_id: Country.find_by(iso: ph[:postalInfo][:addr][:cc]),
|
||||
street: tidy_street,
|
||||
street: ph[:postalInfo][:addr][:street][0],
|
||||
street2: ph[:postalInfo][:addr][:street][1],
|
||||
street3: ph[:postalInfo][:addr][:street][2],
|
||||
zip: ph[:postalInfo][:addr][:pc]
|
||||
}
|
||||
}) if ph[:postalInfo].is_a?(Hash) && ph[:postalInfo][:addr].is_a?(Hash)
|
||||
|
@ -135,16 +137,6 @@ module Epp::ContactsHelper
|
|||
return false
|
||||
end
|
||||
|
||||
def tidy_street
|
||||
command = params[:command]
|
||||
street = params_hash['epp']['command'][command][command][:postalInfo][:addr][:street]
|
||||
return street if street.is_a? String
|
||||
return street.join(',') if street.is_a? Array
|
||||
return nil
|
||||
rescue NoMethodError => e #refactor so wouldn't use rescue for flow control
|
||||
return nil
|
||||
end
|
||||
|
||||
def ident_type
|
||||
result = params[:frame].slice(/(?<=\<ns2:ident type=)(.*)(?=<)/)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue