mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Attach nameservers to domain
This commit is contained in:
parent
f6ce3b4c4e
commit
d01944fe21
5 changed files with 22 additions and 3 deletions
|
@ -61,6 +61,13 @@ class Domain < ActiveRecord::Base
|
|||
)
|
||||
end
|
||||
|
||||
def attach_nameservers(nameservers)
|
||||
nameservers.each do |x|
|
||||
self.nameservers << Nameserver.find_or_create_by(hostname: x)
|
||||
end
|
||||
save!
|
||||
end
|
||||
|
||||
def validate_admin_contacts_count
|
||||
errors.add(:admin_contacts, :blank) if admin_contacts.empty?
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue