mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Add validation
This commit is contained in:
parent
76d397465e
commit
d286a67cc0
8 changed files with 88 additions and 5 deletions
|
@ -64,6 +64,12 @@ class Domain < ActiveRecord::Base
|
|||
false
|
||||
end
|
||||
|
||||
def can_remove_admin_contact?
|
||||
return true if admin_contacts.length > 1
|
||||
errors.add(:admin_contacts, :less_than_or_equal_to, { count: 1 })
|
||||
false
|
||||
end
|
||||
|
||||
def validate_nameservers_count
|
||||
sg = SettingGroup.domain_validation
|
||||
min, max = sg.setting(:ns_min_count).value.to_i, sg.setting(:ns_max_count).value.to_i
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue