Merge pull request #151 from internetee/story/120095555-ipv6-hostname

Story/120095555 ipv6 hostname
This commit is contained in:
Timo Võhmar 2016-06-16 10:57:50 +03:00 committed by GitHub
commit 739b817321
3 changed files with 4 additions and 3 deletions

View file

@ -478,7 +478,8 @@ 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)
end end

View file

@ -32,7 +32,7 @@ class Nameserver < ActiveRecord::Base
[:ipv4, :invalid, { value: { obj: 'hostAddr', val: ipv4 } }], [:ipv4, :invalid, { value: { obj: 'hostAddr', val: ipv4 } }],
[:ipv6, :invalid, { value: { obj: 'hostAddr', val: ipv6 } }] [:ipv6, :invalid, { value: { obj: 'hostAddr', val: ipv6 } }]
], ],
'2306' => [ '2003' => [
[:ipv4, :blank] [:ipv4, :blank]
] ]
} }

View file

@ -136,7 +136,7 @@ en:
taken: 'Nameserver already exists on this domain' taken: 'Nameserver already exists on this domain'
puny_to_long: 'Hostname puny label is too long (maximum is 63 characters)' puny_to_long: 'Hostname puny label is too long (maximum is 63 characters)'
ipv4: ipv4:
blank: 'IPv4 is missing' blank: 'IP is missing'
invalid: 'IPv4 is invalid' invalid: 'IPv4 is invalid'
ipv6: ipv6:
invalid: 'IPv6 is invalid' invalid: 'IPv6 is invalid'