mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Nameservers refactor
This commit is contained in:
parent
57e8bf81e3
commit
1e13c54eb9
9 changed files with 182 additions and 140 deletions
|
@ -6,7 +6,9 @@ class Nameserver < ActiveRecord::Base
|
|||
}
|
||||
|
||||
belongs_to :registrar
|
||||
has_and_belongs_to_many :domains
|
||||
|
||||
has_many :domain_nameservers
|
||||
has_many :domains, through: :domain_nameservers
|
||||
|
||||
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_nil: true }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue