chore: Fix RemoveStaleNotificationJob query (#5242)
Rubocop amended the query in #5236, which led to failure as the Message model already has a default scope. This PR fixes it.
This commit is contained in:
@@ -10,7 +10,8 @@ class Migration::RemoveStaleNotificationsJob < ApplicationJob
|
|||||||
|
|
||||||
def remove_invalid_messages
|
def remove_invalid_messages
|
||||||
deleted_ids = []
|
deleted_ids = []
|
||||||
Message.distinct.pluck(:inbox_id).each_slice(1000) do |id_list|
|
|
||||||
|
Message.unscoped.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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user