fix error

This commit is contained in:
邱博亞 2023-05-06 17:08:51 +08:00
parent 14822f2bbf
commit 34a4181334
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
module MemberCleanCache
extend ActiveSupport::Concern
included do
def destroy_cache
if self.class==Page
MemberIndexCache.where(page_id: self.id).destroy_all
else
MemberIndexCache.all.destroy_all
end
end
after_save do
self.destroy_cache
end
before_destroy do
self.destroy_cache
end
end
end