mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Improve domain discard
- Extract rake task domain:discard - Remove background job when keeping a domain #790
This commit is contained in:
parent
00a30fc019
commit
e776d09f9d
10 changed files with 104 additions and 46 deletions
|
@ -281,13 +281,6 @@ class Domain < ActiveRecord::Base
|
|||
true
|
||||
end
|
||||
|
||||
def delete_candidateable?
|
||||
return false if delete_at > Time.zone.now
|
||||
return false if statuses.include?(DomainStatus::DELETE_CANDIDATE)
|
||||
return false if statuses.include?(DomainStatus::SERVER_DELETE_PROHIBITED)
|
||||
true
|
||||
end
|
||||
|
||||
def renewable?
|
||||
if Setting.days_to_renew_domain_before_expire != 0
|
||||
# if you can renew domain at days_to_renew before domain expiration
|
||||
|
@ -683,10 +676,6 @@ class Domain < ActiveRecord::Base
|
|||
where("#{attribute_alias(:outzone_time)} < ?", Time.zone.now)
|
||||
end
|
||||
|
||||
def self.delete_candidates
|
||||
where('delete_at < ?', Time.zone.now)
|
||||
end
|
||||
|
||||
def self.uses_zone?(zone)
|
||||
exists?(["name ILIKE ?", "%.#{zone.origin}"])
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue