mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
Cleanup
This commit is contained in:
parent
660eef414e
commit
1dc2a7e23f
6 changed files with 4 additions and 143 deletions
|
@ -51,6 +51,9 @@ class Domain < ActiveRecord::Base
|
|||
attr_accessor :adding_tech_contact
|
||||
validate :validate_tech_contacts_max_count, if: :adding_tech_contact
|
||||
|
||||
attr_accessor :deleting_tech_contact
|
||||
# validate :validate_tech_contacts_min_count, if: :deleting_tech_contact
|
||||
|
||||
def name=(value)
|
||||
value.strip!
|
||||
write_attribute(:name, SimpleIDN.to_unicode(value))
|
||||
|
@ -87,12 +90,6 @@ class Domain < ActiveRecord::Base
|
|||
errors.add(:nameservers, :greater_than_or_equal_to, { count: min })
|
||||
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