mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Attach nameservers directly to domain
This commit is contained in:
parent
98c2717539
commit
eb8de6479e
8 changed files with 22 additions and 36 deletions
|
@ -14,8 +14,7 @@ class Domain < ActiveRecord::Base
|
|||
where(domain_contacts: { contact_type: DomainContact::ADMIN })
|
||||
end, through: :domain_contacts, source: :contact
|
||||
|
||||
has_many :domain_nameservers, dependent: :delete_all
|
||||
has_many :nameservers, through: :domain_nameservers
|
||||
has_many :nameservers, dependent: :delete_all
|
||||
|
||||
has_many :domain_statuses, dependent: :delete_all
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
class DomainNameserver < ActiveRecord::Base
|
||||
belongs_to :domain
|
||||
belongs_to :nameserver
|
||||
end
|
|
@ -6,9 +6,7 @@ class Nameserver < ActiveRecord::Base
|
|||
}
|
||||
|
||||
belongs_to :registrar
|
||||
|
||||
has_many :domain_nameservers, dependent: :delete_all
|
||||
has_many :domains, through: :domain_nameservers
|
||||
belongs_to :domain
|
||||
|
||||
validates :hostname, format: { with: /\A(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/ }
|
||||
validates :ipv4, format: { with: /\A(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\z/, allow_blank: true }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue