mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 18:29:40 +02:00
Verify that domain can be deleted
This commit is contained in:
parent
e6c935eae8
commit
0096968265
1 changed files with 7 additions and 0 deletions
|
@ -65,6 +65,13 @@ class Domain < ActiveRecord::Base
|
||||||
domain_transfers.find_by(status: DomainTransfer::PENDING)
|
domain_transfers.find_by(status: DomainTransfer::PENDING)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def can_be_deleted?
|
||||||
|
(domain_statuses.pluck(:value) & %W(
|
||||||
|
#{DomainStatus::CLIENT_DELETE_PROHIBITED}
|
||||||
|
#{DomainStatus::SERVER_DELETE_PROHIBITED}
|
||||||
|
)).empty?
|
||||||
|
end
|
||||||
|
|
||||||
### VALIDATIONS ###
|
### VALIDATIONS ###
|
||||||
def validate_admin_contacts_max_count
|
def validate_admin_contacts_max_count
|
||||||
return if admin_contacts_count < 4
|
return if admin_contacts_count < 4
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue