chore: rubocop fix

This commit is contained in:
Sojan 2022-08-10 13:04:43 +02:00
parent 2d36d3879d
commit 10d0eb063f

View file

@ -10,11 +10,10 @@ class Migration::RemoveStaleNotificationsJob < ApplicationJob
def remove_invalid_messages def remove_invalid_messages
deleted_ids = [] deleted_ids = []
Message.pluck(:inbox_id).uniq.each_slice(1000) do |id_list| Message.distinct.pluck(:inbox_id).each_slice(1000) do |id_list|
deleted_ids << (id_list - Inbox.where(id: id_list).pluck(:id)) deleted_ids << (id_list - Inbox.where(id: id_list).pluck(:id))
end end
Message.where(inbox_id: deleted_ids.flatten).destroy_all Message.where(inbox_id: deleted_ids.flatten).destroy_all
end end
end end