Merge pull request #10110 from demarches-simplifiees/update-bulk-messages-maintenance-tasks

fix(maintenance task): pass a collection instead of an array
This commit is contained in:
Eric Leroy-Terquem 2024-03-13 15:25:35 +00:00 committed by GitHub
commit fc0d27c23a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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)