fix(maintenance task): pass a collection instead of an array

This commit is contained in:
Eric Leroy-Terquem 2024-03-13 15:12:52 +01:00
parent 7ab8345b39
commit 0a8075d8a4
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@
module Maintenance
class BackfillBulkMessagesWithProcedureIdTask < MaintenanceTasks::Task
def collection
BulkMessage.all.filter { |bm| bm.procedure.nil? && bm.groupe_instructeurs.present? }
BulkMessage.where(procedure: nil).where.missing(:groupe_instructeurs)
end
def process(element)

View file

@ -3,7 +3,7 @@
module Maintenance
class DestroyIncompleteBulkMessagesTask < MaintenanceTasks::Task
def collection
BulkMessage.all.filter { |bm| bm.procedure.nil? && bm.groupe_instructeurs.blank? }
BulkMessage.where(procedure: nil).where.missing(:groupe_instructeurs)
end
def process(element)