chore: Fixes the missing gem warning (#3207)

* chore: Fixes the missing gem warning

fixes: #3143

* chore: rubocop fixes

Co-authored-by: Tejaswini Chile <tejaswini776@gmail.com>
This commit is contained in:
Sojan Jose
2021-10-14 13:57:01 +05:30
committed by GitHub
parent 590001cca2
commit 0c65db925d
7 changed files with 115 additions and 96 deletions

View File

@@ -2,7 +2,7 @@ class RemoveNotificationsWithoutPrimaryActor < ActiveRecord::Migration[6.0]
def change
deleted_ids = []
Notification.where(primary_actor_type: 'Conversation').pluck(:primary_actor_id).uniq.each_slice(1000) do |id_list|
deleted_ids << id_list - Conversation.where(id: id_list).pluck(:id)
deleted_ids << (id_list - Conversation.where(id: id_list).pluck(:id))
end
Notification.where(primary_actor_type: 'Conversation', primary_actor_id: deleted_ids).destroy_all
end