mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Story#120095555 - glue nameserver may have IPv4 or IPv6
This commit is contained in:
parent
ad823391b7
commit
999c161c8e
1 changed files with 3 additions and 1 deletions
|
@ -478,9 +478,11 @@ class Domain < ActiveRecord::Base
|
||||||
def validate_nameserver_ips
|
def validate_nameserver_ips
|
||||||
nameservers.to_a.reject(&:marked_for_destruction?).each do |ns|
|
nameservers.to_a.reject(&:marked_for_destruction?).each do |ns|
|
||||||
next unless ns.hostname.end_with?(".#{name}")
|
next unless ns.hostname.end_with?(".#{name}")
|
||||||
next if ns.ipv4.present?
|
next if ns.ipv4.present? || ns.ipv6.present?
|
||||||
|
|
||||||
errors.add(:nameservers, :invalid) if errors[:nameservers].blank?
|
errors.add(:nameservers, :invalid) if errors[:nameservers].blank?
|
||||||
ns.errors.add(:ipv4, :blank)
|
ns.errors.add(:ipv4, :blank)
|
||||||
|
ns.errors.add(:ipv6, :blank)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue