mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Story#109070142 - EPP can save updated nameservers
This commit is contained in:
parent
cdbcc5f9b5
commit
d1dd65af3a
2 changed files with 13 additions and 4 deletions
|
@ -201,7 +201,7 @@ class Epp::Domain < Domain
|
||||||
if action == 'rem'
|
if action == 'rem'
|
||||||
to_destroy = []
|
to_destroy = []
|
||||||
ns_list.each do |ns_attrs|
|
ns_list.each do |ns_attrs|
|
||||||
nameserver = nameservers.where(ns_attrs).try(:first)
|
nameserver = nameservers.find_by_hash_params(ns_attrs).first
|
||||||
if nameserver.blank?
|
if nameserver.blank?
|
||||||
add_epp_error('2303', 'hostAttr', ns_attrs[:hostname], [:nameservers, :not_found])
|
add_epp_error('2303', 'hostAttr', ns_attrs[:hostname], [:nameservers, :not_found])
|
||||||
else
|
else
|
||||||
|
@ -223,8 +223,8 @@ class Epp::Domain < Domain
|
||||||
frame.css('hostAttr').each do |x|
|
frame.css('hostAttr').each do |x|
|
||||||
host_attr = {
|
host_attr = {
|
||||||
hostname: x.css('hostName').first.try(:text),
|
hostname: x.css('hostName').first.try(:text),
|
||||||
ipv4: x.css('hostAddr[ip="v4"]').first.try(:text),
|
ipv4: x.css('hostAddr[ip="v4"]').map(&:text).compact,
|
||||||
ipv6: x.css('hostAddr[ip="v6"]').first.try(:text)
|
ipv6: x.css('hostAddr[ip="v6"]').map(&:text).compact
|
||||||
}
|
}
|
||||||
|
|
||||||
res << host_attr.delete_if { |_k, v| v.blank? }
|
res << host_attr.delete_if { |_k, v| v.blank? }
|
||||||
|
|
|
@ -89,5 +89,14 @@ class Nameserver < ActiveRecord::Base
|
||||||
return 'replaced_all' if prc == 1.0
|
return 'replaced_all' if prc == 1.0
|
||||||
'replaced_some'
|
'replaced_some'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_by_hash_params params
|
||||||
|
params = params.with_indifferent_access
|
||||||
|
rel = all
|
||||||
|
rel = rel.where(hostname: params[:hostname])
|
||||||
|
# rel = rel.where(hostname: params[:hostname]) if params[:ipv4]
|
||||||
|
# ignoring ips
|
||||||
|
rel
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue