Merge pull request #1854 from internetee/optimize-whois-record-delete-sql

Optimize WHOIS record destroy SQL check
This commit is contained in:
Timo Võhmar 2021-02-12 13:15:04 +02:00 committed by GitHub
commit 752bdedf1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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