Optimize WHOIS record destroy SQL check

This commit is contained in:
Karl Erik Õunapuu 2021-02-12 13:01:28 +02:00
parent 25e0b61a15
commit 06ae9b8e24
No known key found for this signature in database
GPG key ID: C9DD647298A34764

View file

@ -97,7 +97,9 @@ class WhoisRecord < ApplicationRecord
end
def destroy_whois_record
Whois::Record.without_auctions.where(name: name).delete_all
return if Auction.find_by(domain: name).present?
Whois::Record.where(name: name).delete_all
end
private