From a5d38c7b3324a45b1d6ce96462357b5ac7678b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andres=20Keskk=C3=BCla?= Date: Tue, 26 Aug 2014 16:18:21 +0300 Subject: [PATCH] renamed xml array attribute check --- app/controllers/concerns/epp/common.rb | 2 +- app/helpers/epp/contacts_helper.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/concerns/epp/common.rb b/app/controllers/concerns/epp/common.rb index 7b4b9abf5..6a40e5a60 100644 --- a/app/controllers/concerns/epp/common.rb +++ b/app/controllers/concerns/epp/common.rb @@ -60,7 +60,7 @@ module Epp::Common epp_errors.empty? end - def xml_nested_attrs_present?(array_ph, attributes ) + def xml_attrs_array_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) diff --git a/app/helpers/epp/contacts_helper.rb b/app/helpers/epp/contacts_helper.rb index 38008d868..481bd564e 100644 --- a/app/helpers/epp/contacts_helper.rb +++ b/app/helpers/epp/contacts_helper.rb @@ -53,9 +53,9 @@ module Epp %w(postalInfo)]) return epp_errors.empty? unless @ph['postalInfo'].is_a?(Hash) || @ph['postalInfo'].is_a?(Array) - xml_nested_attrs_present?(@ph['postalInfo'], [%w(name), - %w(addr city), - %w(addr cc)]) + xml_attrs_array_present?(@ph['postalInfo'], [%w(name), + %w(addr city), + %w(addr cc)]) end ## UPDATE