* Attempt number 1 * Fix rack_attack specs * Fix users_searches_users spec * Fix display_users_search_spec * Fix comment typo * Remove search:destroy task from cypress * Remove port 9300 from gitpod * Stub response in attack_spec
17 lines
379 B
Ruby
17 lines
379 B
Ruby
module Users
|
|
module DeleteComments
|
|
module_function
|
|
|
|
def call(user)
|
|
return unless user.comments.any?
|
|
|
|
user.comments.find_each do |comment|
|
|
comment.reactions.delete_all
|
|
EdgeCache::BustComment.call(comment.commentable)
|
|
comment.remove_notifications
|
|
comment.delete
|
|
end
|
|
EdgeCache::BustUser.call(user)
|
|
end
|
|
end
|
|
end
|