107997032-whois_db_delete

(cherry picked from commit c4dbd4c)
This commit is contained in:
Stas 2015-11-17 14:43:50 +02:00
parent a9204b8e22
commit 3ea53ad016

View file

@ -7,6 +7,7 @@ class WhoisRecord < ActiveRecord::Base
before_validation :populate
after_save :update_whois_server
after_destroy :destroy_whois_record
class << self
def included
@ -109,4 +110,8 @@ class WhoisRecord < ActiveRecord::Base
wd.json = json
wd.save
end
def destroy_whois_record
Whois::Record.where(name: name).delete_all()
end
end