Turn off removing auctioned Whois::Record

This commit is contained in:
Alex Sherman 2021-01-15 15:32:40 +05:00
parent 1d5c46e6a0
commit 59ddc5acce
2 changed files with 7 additions and 1 deletions

View file

@ -2,6 +2,12 @@ module Whois
class Record < Whois::Server
self.table_name = 'whois_records'
def self.without_auctions
ids = Whois::Record.all.select { |record| Auction.where(domain: record.name).blank? }
.pluck(:id)
Whois::Record.where(id: ids)
end
def self.disclaimer
Setting.registry_whois_disclaimer
end

View file

@ -97,7 +97,7 @@ class WhoisRecord < ApplicationRecord
end
def destroy_whois_record
Whois::Record.where(name: name).delete_all
Whois::Record.without_auctions.where(name: name).delete_all
end
private