docbrown/app/services/users/delete_comments.rb
Alex 393ba00221
Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606)
* 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
2021-05-03 11:09:45 -04:00

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