fix error
This commit is contained in:
1 parent
38e130664e
commit
430c673fdf
3 files changed
+10
-2
No files matched your search
@@ -7,6 +7,10 @@ module FeedModel
|
||||
before_save :do_before_save
|
||||
end
|
||||
def recreate_annc_cache(feed)
|
||||
count = SiteFeedAnnc.where(feed_id: feed.id).count
|
||||
if count>1
|
||||
SiteFeedAnnc.where(feed_id: feed.id).limit(count-1).destroy
|
||||
end
|
||||
tmp = SiteFeedAnnc.where(feed_id: feed.id).first
|
||||
if tmp.nil?
|
||||
tmp = SiteFeedAnnc.new(feed_id: feed.id)
|
||||
|
||||
Reference in new issue
Block a user