mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
Better naming and domain updating
This commit is contained in:
parent
fe54f327d9
commit
8b8a71c4d1
6 changed files with 50 additions and 22 deletions
|
@ -51,7 +51,7 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
### CREATE & UPDATE ###
|
||||
|
||||
def attach_objects(ph, parsed_frame)
|
||||
def parse_and_attach_domain_dependencies(ph, parsed_frame)
|
||||
attach_owner_contact(ph[:registrant]) if ph[:registrant]
|
||||
attach_contacts(self.class.parse_contacts_from_frame(parsed_frame))
|
||||
attach_nameservers(self.class.parse_nameservers_from_frame(parsed_frame))
|
||||
|
@ -60,7 +60,7 @@ class Domain < ActiveRecord::Base
|
|||
errors.empty?
|
||||
end
|
||||
|
||||
def detach_objects(ph, parsed_frame)
|
||||
def parse_and_detach_domain_dependencies(parsed_frame)
|
||||
detach_contacts(self.class.parse_contacts_from_frame(parsed_frame))
|
||||
detach_nameservers(self.class.parse_nameservers_from_frame(parsed_frame))
|
||||
detach_statuses(self.class.parse_statuses_from_frame(parsed_frame))
|
||||
|
@ -68,6 +68,19 @@ class Domain < ActiveRecord::Base
|
|||
errors.empty?
|
||||
end
|
||||
|
||||
def parse_and_update_domain_dependencies(parsed_frame)
|
||||
owner_contact_code = parsed_frame.css('registrant').try(:text)
|
||||
attach_owner_contact(owner_contact_code) if owner_contact_code.present?
|
||||
|
||||
errors.empty?
|
||||
end
|
||||
|
||||
def parse_and_update_domain_attributes(parsed_frame)
|
||||
assign_attributes(self.class.parse_update_params_from_frame(parsed_frame))
|
||||
|
||||
errors.empty?
|
||||
end
|
||||
|
||||
def attach_owner_contact(code)
|
||||
self.owner_contact = Contact.find_by(code: code)
|
||||
|
||||
|
@ -324,6 +337,15 @@ class Domain < ActiveRecord::Base
|
|||
res
|
||||
end
|
||||
|
||||
def parse_update_params_from_frame(parsed_frame)
|
||||
ret = {}
|
||||
return ret if parsed_frame.blank?
|
||||
|
||||
ret[:auth_info] = parsed_frame.css('pw').try(:text)
|
||||
|
||||
ret.compact
|
||||
end
|
||||
|
||||
def check_availability(domains)
|
||||
domains = [domains] if domains.is_a?(String)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue