mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 18:29:40 +02:00
renamed xml array attribute check
This commit is contained in:
parent
3b7289607c
commit
a5d38c7b33
2 changed files with 4 additions and 4 deletions
|
@ -60,7 +60,7 @@ module Epp::Common
|
||||||
epp_errors.empty?
|
epp_errors.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
def xml_nested_attrs_present?(array_ph, attributes )
|
def xml_attrs_array_present?(array_ph, attributes )
|
||||||
[array_ph].flatten.each do |ph|
|
[array_ph].flatten.each do |ph|
|
||||||
attributes.each do |x|
|
attributes.each do |x|
|
||||||
epp_errors << {code: '2003', msg: I18n.t('errors.messages.required_parameter_missing', key: x.last)} unless has_attribute(ph, x)
|
epp_errors << {code: '2003', msg: I18n.t('errors.messages.required_parameter_missing', key: x.last)} unless has_attribute(ph, x)
|
||||||
|
|
|
@ -53,9 +53,9 @@ module Epp
|
||||||
%w(postalInfo)])
|
%w(postalInfo)])
|
||||||
return epp_errors.empty? unless @ph['postalInfo'].is_a?(Hash) || @ph['postalInfo'].is_a?(Array)
|
return epp_errors.empty? unless @ph['postalInfo'].is_a?(Hash) || @ph['postalInfo'].is_a?(Array)
|
||||||
|
|
||||||
xml_nested_attrs_present?(@ph['postalInfo'], [%w(name),
|
xml_attrs_array_present?(@ph['postalInfo'], [%w(name),
|
||||||
%w(addr city),
|
%w(addr city),
|
||||||
%w(addr cc)])
|
%w(addr cc)])
|
||||||
end
|
end
|
||||||
|
|
||||||
## UPDATE
|
## UPDATE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue