db(bulk messages): destroy bulk_messages without procedure or groupe instructeur

This commit is contained in:
Eric Leroy-Terquem 2024-03-05 17:07:13 +01:00
parent 847d4d4c9b
commit 31ba16da02

View file

@ -0,0 +1,13 @@
# frozen_string_literal: true
module Maintenance
class DestroyIncompleteBulkMessagesTask < MaintenanceTasks::Task
def collection
BulkMessage.all.filter { |bm| bm.procedure.nil? && bm.groupe_instructeurs.blank? }
end
def process(element)
element.destroy
end
end
end