docbrown/app/workers/comments/bust_cache_worker.rb

13 lines
312 B
Ruby

module Comments
class BustCacheWorker < BustCacheBaseWorker
def perform(comment_id)
comment = Comment.find_by(id: comment_id)
return unless comment&.commentable
comment.purge
comment.commentable.purge
EdgeCache::Commentable::Bust.call(comment.commentable)
end
end
end