mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +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
|
@ -60,6 +60,15 @@ module Epp::Common
|
|||
epp_errors.empty?
|
||||
end
|
||||
|
||||
def xml_nested_attrs_present?(array_ph, attributes )
|
||||
[array_ph].flatten.each do |ph|
|
||||
attributes.each do |x|
|
||||
epp_errors << {code: '2003', msg: I18n.t('errors.messages.required_parameter_missing', key: x.last)} unless has_attribute(ph, x)
|
||||
end
|
||||
end
|
||||
epp_errors.empty?
|
||||
end
|
||||
|
||||
def has_attribute(ph, path)
|
||||
path.reduce(ph) do |location, key|
|
||||
location.respond_to?(:keys) ? location[key] : nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue