mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 15:34:41 +02:00
18 lines
434 B
Ruby
18 lines
434 B
Ruby
class Domain < ActiveRecord::Base
|
|
belongs_to :registrar
|
|
belongs_to :ns_set
|
|
belongs_to :owner_contact, class_name: 'Contact'
|
|
belongs_to :technical_contact, class_name: 'Contact'
|
|
belongs_to :admin_contact, class_name: 'Contact'
|
|
|
|
class << self
|
|
def check_availability(domains)
|
|
res = []
|
|
domains.each do |x|
|
|
res << {name: x, avail: Domain.find_by(name: x) ? 0 : 1}
|
|
end
|
|
|
|
res
|
|
end
|
|
end
|
|
end
|