From 18517fd10c2a7d93ee8695196025071950ddbf18 Mon Sep 17 00:00:00 2001 From: Stas Date: Tue, 17 Nov 2015 13:14:16 +0200 Subject: [PATCH] 107997032-whois_domain_delete --- app/models/domain.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/domain.rb b/app/models/domain.rb index 7237a24ed..8d5949192 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -301,12 +301,14 @@ class Domain < ActiveRecord::Base c = 0 Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x| + Whois::Record.where('domain_id = ?', x.id).try(':destroy') x.destroy STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by deleteCandidate ##{x.id} (#{x.name})\n" unless Rails.env.test? c += 1 end Domain.where('force_delete_at <= ?', Time.zone.now).each do |x| + Whois::Record.where('domain_id = ?', x.id).try(':destroy') x.destroy STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test? c += 1