mirror of
https://github.com/internetee/registry.git
synced 2025-05-29 17:10:08 +02:00
Cleanup
This commit is contained in:
parent
290d7470f8
commit
90f29f91ee
1 changed files with 0 additions and 15 deletions
|
@ -33,7 +33,6 @@ class Domain < ActiveRecord::Base
|
||||||
validates :owner_contact, presence: true
|
validates :owner_contact, presence: true
|
||||||
|
|
||||||
validate :validate_period
|
validate :validate_period
|
||||||
#validate :validate_nameservers_uniqueness
|
|
||||||
|
|
||||||
def name=(value)
|
def name=(value)
|
||||||
value.strip!
|
value.strip!
|
||||||
|
@ -56,20 +55,6 @@ class Domain < ActiveRecord::Base
|
||||||
errors.add(:nameservers, :out_of_range, { min: min, max: max })
|
errors.add(:nameservers, :out_of_range, { min: min, max: max })
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_nameservers_uniqueness
|
|
||||||
validated = []
|
|
||||||
nameservers.each do |ns|
|
|
||||||
next if validated.include?(ns.hostname)
|
|
||||||
|
|
||||||
existing = nameservers.select { |x| x.hostname == ns.hostname }
|
|
||||||
if existing.length > 1
|
|
||||||
validated << ns.hostname
|
|
||||||
errors.add(:nameservers, :taken)
|
|
||||||
add_epp_error('2302', 'hostObj', ns.hostname, [:nameservers, :taken])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def validate_admin_contacts_count
|
def validate_admin_contacts_count
|
||||||
errors.add(:admin_contacts, :out_of_range) if admin_contacts_count.zero?
|
errors.add(:admin_contacts, :out_of_range) if admin_contacts_count.zero?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue