mirror of
https://github.com/internetee/registry.git
synced 2025-05-28 13:51:41 +02:00
parent
3c4cba93f4
commit
d39d3766b2
9 changed files with 484 additions and 11 deletions
|
@ -141,7 +141,7 @@ class Domain < ActiveRecord::Base
|
|||
false
|
||||
end
|
||||
|
||||
validates :nameservers, object_count: {
|
||||
validates :nameservers, domain_nameserver: {
|
||||
min: -> { Setting.ns_min_count },
|
||||
max: -> { Setting.ns_max_count }
|
||||
}
|
||||
|
@ -692,6 +692,11 @@ class Domain < ActiveRecord::Base
|
|||
p_d = statuses.include?(DomainStatus::PENDING_DELETE)
|
||||
s_h = (statuses & [DomainStatus::SERVER_MANUAL_INZONE, DomainStatus::SERVER_HOLD]).empty?
|
||||
statuses << DomainStatus::SERVER_HOLD if p_d && s_h
|
||||
|
||||
if !self.class.nameserver_required?
|
||||
statuses << DomainStatus::INACTIVE if nameservers.empty?
|
||||
statuses.delete(DomainStatus::INACTIVE) if nameservers.size >= Setting.ns_min_count
|
||||
end
|
||||
end
|
||||
# rubocop: enable Metrics/CyclomaticComplexity
|
||||
# rubocop: enable Metrics/PerceivedComplexity
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue