mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +02:00
fixed bag, added test
This commit is contained in:
parent
3fb1ccb41f
commit
3d9a763f32
3 changed files with 29 additions and 16 deletions
|
@ -53,11 +53,6 @@ module Depp
|
|||
current_user.request(xml)
|
||||
end
|
||||
|
||||
def hostname_present
|
||||
domain_params[:nameservers_attributes]
|
||||
.select { |_key, value| value['hostname'].present? }.any?
|
||||
end
|
||||
|
||||
def create(domain_params)
|
||||
dns_hash = {}
|
||||
keys = Domain.create_dnskeys_hash(domain_params)
|
||||
|
@ -66,16 +61,16 @@ module Depp
|
|||
period = domain_params[:period].to_i.to_s
|
||||
period_unit = domain_params[:period][-1].to_s
|
||||
|
||||
xml = if hostname_present
|
||||
epp_xml.create({
|
||||
xml = if domain_params[:nameservers_attributes].select { |key, value| value['hostname'].present? }.any?
|
||||
epp_xml.create({
|
||||
name: { value: domain_params[:name] },
|
||||
period: { value: period, attrs: { unit: period_unit } },
|
||||
ns: Domain.create_nameservers_hash(domain_params),
|
||||
registrant: { value: domain_params[:registrant] },
|
||||
_anonymus: Domain.create_contacts_hash(domain_params)
|
||||
}, dns_hash, Domain.construct_custom_params_hash(domain_params))
|
||||
else
|
||||
epp_xml.create({
|
||||
else
|
||||
epp_xml.create({
|
||||
name: { value: domain_params[:name] },
|
||||
period: { value: period, attrs: { unit: period_unit } },
|
||||
registrant: { value: domain_params[:registrant] },
|
||||
|
@ -242,12 +237,9 @@ module Depp
|
|||
rem_arr << { ns: rem_ns } if rem_ns.any?
|
||||
rem_arr << { _anonymus: rem_anon } if rem_anon.any?
|
||||
|
||||
return if domain_params[:registrant] == old_domain_params[:registrant]
|
||||
|
||||
chg = [{ registrant: { value: domain_params[:registrant] } }]
|
||||
if domain_params[:verified].blank? && (domain_params[:verified])
|
||||
chg = [{ registrant: { value: domain_params[:registrant],
|
||||
attrs: { verified: 'yes' } } }]
|
||||
if domain_params[:registrant] != old_domain_params[:registrant]
|
||||
chg = [{ registrant: { value: domain_params[:registrant] } }] unless domain_params[:verified].present?
|
||||
chg = [{ registrant: { value: domain_params[:registrant], attrs: { verified: 'yes' } } }] if domain_params[:verified]
|
||||
end
|
||||
|
||||
add_arr = nil if add_arr.none?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue