mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
Add test #2622
This commit is contained in:
parent
d9aaab1e92
commit
cd1f04f155
3 changed files with 34 additions and 7 deletions
|
@ -221,6 +221,18 @@ class Domain < ActiveRecord::Base
|
|||
true
|
||||
end
|
||||
|
||||
def renewable?
|
||||
if Setting.days_to_renew_domain_before_expire != 0
|
||||
if (valid_to - Time.zone.now).to_i / 1.day >= Setting.days_to_renew_domain_before_expire
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return false if domain_statuses.where(value: DomainStatus::DELETE_CANDIDATE).any?
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
def pending_update?
|
||||
(domain_statuses.pluck(:value) & %W(
|
||||
#{DomainStatus::PENDING_UPDATE}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue