db(bulk messages): destroy bulk_messages without procedure or groupe instructeur
This commit is contained in:
parent
847d4d4c9b
commit
31ba16da02
1 changed files with 13 additions and 0 deletions
|
@ -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
|
Loading…
Reference in a new issue