added record for successfully validated nameservers

This commit is contained in:
olegphenomenon 2022-01-06 15:23:21 +02:00
parent d896e5f716
commit a9a95e373c
3 changed files with 39 additions and 3 deletions

View file

@ -34,6 +34,8 @@ class Nameserver < ApplicationRecord
delegate :name, to: :domain, prefix: true
scope :non_validated, -> { where(validation_datetime: nil) }
self.ignored_columns = %w[legacy_domain_id]
def epp_code_map
@ -53,6 +55,18 @@ class Nameserver < ApplicationRecord
}
end
def nameserver_failed_validation?
return false if validation_counter.nil?
validation_counter >= NameserverValidator::VALID_NAMESERVER_COUNT_THRESHOLD
end
def validated?
return false if validation_datetime.nil?
validation_datetime + NameserverValidator::VALIDATION_NAMESERVER_PERIOD > Time.zone.now
end
def to_s
hostname
end