From c83fa049c7a61fcbdde4e6535573dc1fd6d3dced Mon Sep 17 00:00:00 2001 From: Stas Date: Mon, 14 Dec 2015 18:09:38 +0200 Subject: [PATCH 1/3] 109818648-domains_destroy_change --- app/models/domain.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index 780ff3b7a..6d20574ce 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -307,7 +307,7 @@ class Domain < ActiveRecord::Base c = 0 Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x| - Whois::Record.where('domain_id = ?', x.id).try(':destroy') + Whois::Record.where(domain_id: x.id).destroy_all destroy_with_message x STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by deleteCandidate ##{x.id} (#{x.name})\n" unless Rails.env.test? @@ -315,7 +315,7 @@ class Domain < ActiveRecord::Base end Domain.where('force_delete_at <= ?', Time.zone.now).each do |x| - Whois::Record.where('domain_id = ?', x.id).try(':destroy') + Whois::Record.where(domain_id: x.id).destroy_all destroy_with_message x STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test? c += 1 From 6842fbccd64ff2fbbe7d6dd499604add402d0f42 Mon Sep 17 00:00:00 2001 From: Stas Date: Wed, 16 Dec 2015 11:37:02 +0200 Subject: [PATCH 2/3] 109818648-whois_view_change --- app/models/whois_record.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index 21db2bdc0..121677c4d 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -44,7 +44,7 @@ class WhoisRecord < ActiveRecord::Base h[:changed] = domain.updated_at.try(:to_s, :iso8601) h[:expire] = domain.valid_to.try(:to_date).try(:to_s) h[:outzone] = domain.outzone_at.try(:to_date).try(:to_s) - h[:delete] = domain.delete_at.try(:to_date).try(:to_s) + h[:delete] = [domain.delete_at, domain.force_delete_at].compact.min.try(:to_date).try(:to_s) h[:registrant] = domain.registrant.name From 375d8a7b9659141c11d8fc8aa9413137dd43467b Mon Sep 17 00:00:00 2001 From: Stas Date: Thu, 17 Dec 2015 14:00:01 +0200 Subject: [PATCH 3/3] 109818648-model_changed --- app/models/domain.rb | 4 ++-- app/models/whois_record.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index 6d20574ce..07ba09dc4 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -307,7 +307,7 @@ class Domain < ActiveRecord::Base c = 0 Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x| - Whois::Record.where(domain_id: x.id).destroy_all + WhoisRecord.where(domain_id: x.id).destroy_all destroy_with_message x STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by deleteCandidate ##{x.id} (#{x.name})\n" unless Rails.env.test? @@ -315,7 +315,7 @@ class Domain < ActiveRecord::Base end Domain.where('force_delete_at <= ?', Time.zone.now).each do |x| - Whois::Record.where(domain_id: x.id).destroy_all + WhoisRecord.where(domain_id: x.id).destroy_all destroy_with_message x STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test? c += 1 diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index 121677c4d..55cc997da 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -113,6 +113,6 @@ class WhoisRecord < ActiveRecord::Base end def destroy_whois_record - Whois::Record.where(name: name).delete_all() + Whois::Record.where(name: name).delete_all end end