* Refactor EdgeCache * Update specs * Add bust comment spec * Fix more specs * Use const_get * Make methods private * Add .discussion? decorator to Article * Change variable name to article for clarity
13 lines
310 B
Ruby
13 lines
310 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::BustCommentable.call(comment.commentable)
|
|
end
|
|
end
|
|
end
|