docbrown/app/services/edge_cache/commentable/bust.rb
cyrillefr 369aeb9130 Fix comment deletion bug (#3732)
Fix bug where deleted comment still appears on user's profile
2019-08-27 17:07:09 -04:00

24 lines
501 B
Ruby

module EdgeCache
module Commentable
class Bust
def initialize(commentable, cache_buster = CacheBuster.new)
@commentable = commentable
@cache_buster = cache_buster
end
def self.call(*args)
new(*args).call
end
def call
cache_buster.bust_comment(commentable)
cache_buster.bust("#{commentable.path}/comments")
commentable.index!
end
private
attr_reader :commentable, :cache_buster
end
end
end