[deploy] Bug Fix:Remove More ReadingList Index Code (#10439)

This commit is contained in:
Molly Struve 2020-09-25 13:40:54 -05:00 committed by GitHub
parent fb707621d0
commit 9eb0833134
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 18 deletions

View file

@ -37,7 +37,7 @@ module Users
def delete_profile_info(user)
user.notifications.delete_all
remove_reactions(user)
user.reactions.delete_all
user.follows.delete_all
Follow.followable_user(user.id).delete_all
user.messages.delete_all
@ -49,13 +49,5 @@ module Users
user.organization_memberships.delete_all
user.profile_pins.delete_all
end
def remove_reactions(user)
readinglist_ids = user.reactions.readinglist.ids
user.reactions.delete_all
readinglist_ids.each do |id|
Search::RemoveFromIndexWorker.perform_async("Search::Reaction", id)
end
end
end
end

View file

@ -7,7 +7,7 @@ module Users
virtual_articles = user.articles.map { |article| Article.new(article.attributes) }
user.articles.find_each do |article|
remove_reactions(article)
article.reactions.delete_all
article.buffer_updates.delete_all
article.comments.includes(:user).find_each do |comment|
comment.reactions.delete_all
@ -24,13 +24,5 @@ module Users
cache_buster.bust_article(article)
end
end
def remove_reactions(article)
readinglist_ids = article.reactions.readinglist.ids
article.reactions.delete_all
readinglist_ids.each do |id|
Search::RemoveFromIndexWorker.perform_async("Search::Reaction", id)
end
end
end
end