mirror of
https://github.com/internetee/registry.git
synced 2025-07-19 17:25:57 +02:00
More test fixes #2623
This commit is contained in:
parent
6229d6cb35
commit
6ad458e20f
3 changed files with 18 additions and 19 deletions
|
@ -244,12 +244,6 @@ class Domain < ActiveRecord::Base
|
|||
domain_transfers.find_by(status: DomainTransfer::PENDING)
|
||||
end
|
||||
|
||||
def can_be_deleted?
|
||||
(domain_statuses.pluck(:value) & %W(
|
||||
#{DomainStatus::SERVER_DELETE_PROHIBITED}
|
||||
)).empty?
|
||||
end
|
||||
|
||||
def expirable?
|
||||
return false if valid_to > Time.zone.now
|
||||
!statuses.include?(DomainStatus::EXPIRED)
|
||||
|
@ -338,9 +332,7 @@ class Domain < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def pending_delete?
|
||||
(domain_statuses.pluck(:value) & %W(
|
||||
#{DomainStatus::PENDING_DELETE}
|
||||
)).present?
|
||||
statuses.include?(DomainStatus::PENDING_DELETE)
|
||||
end
|
||||
|
||||
def pending_delete!
|
||||
|
@ -348,7 +340,9 @@ class Domain < ActiveRecord::Base
|
|||
self.epp_pending_delete = true # for epp
|
||||
|
||||
return true unless registrant_verification_asked?
|
||||
domain_statuses.create(value: DomainStatus::PENDING_DELETE)
|
||||
statuses << DomainStatus::PENDING_DELETE
|
||||
save(validate: false) # should check if this did succeed
|
||||
|
||||
DomainMailer.pending_deleted(self).deliver_now
|
||||
end
|
||||
|
||||
|
|
|
@ -659,9 +659,7 @@ class Epp::Domain < Domain
|
|||
begin
|
||||
errors.add(:base, :domain_status_prohibits_operation)
|
||||
return false
|
||||
end if (domain_statuses.pluck(:value) & %W(
|
||||
#{DomainStatus::CLIENT_DELETE_PROHIBITED}
|
||||
)).any?
|
||||
end if statuses.include?(DomainStatus::CLIENT_DELETE_PROHIBITED)
|
||||
|
||||
true
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue