mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
Clear CC issues
This commit is contained in:
parent
26e7fd870c
commit
b2c2342d7d
3 changed files with 6 additions and 8 deletions
|
@ -12,16 +12,15 @@ class DisputeStatusUpdateJob < Que::Job
|
||||||
end
|
end
|
||||||
|
|
||||||
def close_disputes
|
def close_disputes
|
||||||
disputes = Dispute.where(closed: false).where('expires_at < ?', Date.today).all
|
disputes = Dispute.where(closed: false).where('expires_at < ?', Time.zone.today).all
|
||||||
Rails.logger.info "DisputeStatusCloseJob - Found #{disputes.count} closable disputes"
|
Rails.logger.info "DisputeStatusCloseJob - Found #{disputes.count} closable disputes"
|
||||||
disputes.each do |dispute|
|
disputes.each do |dispute|
|
||||||
puts "attempnt"
|
|
||||||
close_dispute(dispute)
|
close_dispute(dispute)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def activate_disputes
|
def activate_disputes
|
||||||
disputes = Dispute.where(closed: false, starts_at: Date.today).all
|
disputes = Dispute.where(closed: false, starts_at: Time.zone.today).all
|
||||||
Rails.logger.info "DisputeStatusCloseJob - Found #{disputes.count} activatable disputes"
|
Rails.logger.info "DisputeStatusCloseJob - Found #{disputes.count} activatable disputes"
|
||||||
|
|
||||||
disputes.each do |dispute|
|
disputes.each do |dispute|
|
||||||
|
|
|
@ -15,8 +15,8 @@ class Dispute < ApplicationRecord
|
||||||
before_save :generate_data
|
before_save :generate_data
|
||||||
after_destroy :remove_data
|
after_destroy :remove_data
|
||||||
|
|
||||||
scope :expired, -> { where('expires_at < ?', Date.today) }
|
scope :expired, -> { where('expires_at < ?', Time.zone.today) }
|
||||||
scope :active, -> { where('expires_at > ? AND closed = false', Date.today) }
|
scope :active, -> { where('expires_at > ? AND closed = false', Time.zone.today) }
|
||||||
scope :closed, -> { where(closed: true) }
|
scope :closed, -> { where(closed: true) }
|
||||||
|
|
||||||
alias_attribute :name, :domain_name
|
alias_attribute :name, :domain_name
|
||||||
|
@ -41,7 +41,7 @@ class Dispute < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def generate_data
|
def generate_data
|
||||||
return if starts_at > Date.today
|
return if starts_at > Time.zone.today
|
||||||
|
|
||||||
wr = Whois::Record.find_or_initialize_by(name: domain_name)
|
wr = Whois::Record.find_or_initialize_by(name: domain_name)
|
||||||
if for_active_domain?
|
if for_active_domain?
|
||||||
|
@ -58,7 +58,6 @@ class Dispute < ApplicationRecord
|
||||||
return false unless update(closed: true)
|
return false unless update(closed: true)
|
||||||
return if Dispute.active.where(domain_name: domain_name).any?
|
return if Dispute.active.where(domain_name: domain_name).any?
|
||||||
|
|
||||||
puts "PASS"
|
|
||||||
whois_record = Whois::Record.find_or_initialize_by(name: domain_name)
|
whois_record = Whois::Record.find_or_initialize_by(name: domain_name)
|
||||||
return true if remove_whois_data(whois_record)
|
return true if remove_whois_data(whois_record)
|
||||||
|
|
||||||
|
|
|
@ -294,7 +294,7 @@ class Domain < ApplicationRecord
|
||||||
def renewable?
|
def renewable?
|
||||||
if Setting.days_to_renew_domain_before_expire != 0
|
if Setting.days_to_renew_domain_before_expire != 0
|
||||||
# if you can renew domain at days_to_renew before domain expiration
|
# if you can renew domain at days_to_renew before domain expiration
|
||||||
if (expire_time.to_date - Date.today) + 1 > Setting.days_to_renew_domain_before_expire
|
if (expire_time.to_date - Time.zone.today) + 1 > Setting.days_to_renew_domain_before_expire
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue