This commit is contained in:
Martin Lensment 2015-06-10 13:10:26 +03:00
parent d9aaab1e92
commit cd1f04f155
3 changed files with 34 additions and 7 deletions

View file

@ -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}