118822101-builder_changes_for_array_error

(cherry picked from commit e7841b5)
This commit is contained in:
Stas 2016-07-31 19:38:41 +03:00 committed by Vladimir Krylov
parent 0e4a03517f
commit 436846cfe9
2 changed files with 8 additions and 2 deletions

View file

@ -24,7 +24,7 @@ class Nameserver < ActiveRecord::Base
def epp_code_map
{
'2302' => [
[:hostname, :taken, { value: { obj: 'hostAttr', val: hostname } }]
[:hostname, :taken, { value: { obj: 'hostAttr', val: {'hostName': hostname} } }]
],
'2005' => [
[:hostname, :invalid, { value: { obj: 'hostAttr', val: hostname } }],

View file

@ -12,7 +12,13 @@ xml.epp_head do
if (val = value).respond_to?(:each)
val.each do |el|
xml.tag!("#{model_name}:#{x[:value][:obj]}", el, attrs)
if el.kind_of?(Array)
xml.tag!("#{model_name}:#{x[:value][:obj]}") do
xml.tag!("#{model_name}:#{el[0]}", el[1], attrs)
end
else
xml.tag!("#{model_name}:#{x[:value][:obj]}", el, attrs)
end
end
else
xml.tag!("#{model_name}:#{x[:value][:obj]}", val, attrs)