From aca4818b7bd6f21bc0507f25a37ca60b8f67f164 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 1 Sep 2020 14:24:28 +0800 Subject: [PATCH] fix error --- lib/bulletin_model/cache.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/bulletin_model/cache.rb b/lib/bulletin_model/cache.rb index d595629..461fbf5 100644 --- a/lib/bulletin_model/cache.rb +++ b/lib/bulletin_model/cache.rb @@ -10,7 +10,8 @@ module BulletinModel AnnsCache.where(parent_id:self.id).destroy elsif self.class == Bulletin || (self.class == Page && self.module == "announcement") if self.class == Bulletin - BulletinFeedCache.where(:uid.in => BulletinFeed.where(:tag_ids.in => Array(self.tag_ids).collect{|v| v.to_s}).pluck(:uid)).destroy + tmp_tag_ids = (Array(self.tag_ids) + Array(Bulletin.find(self.id).tag_ids)).uniq + BulletinFeedCache.where(:uid.in => BulletinFeed.where(:tag_ids.in => tmp_tag_ids.collect{|v| v.to_s}).pluck(:uid)).destroy end AnnsCache.all.destroy end