mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
7 lines
417 B
Ruby
7 lines
417 B
Ruby
class Nameserver < ActiveRecord::Base
|
|
belongs_to :registrar
|
|
has_and_belongs_to_many :domains
|
|
|
|
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 :ip, 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 }
|
|
end
|