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