demarches-normaliennes/app/tasks/maintenance/destroy_incomplete_bulk_messages_task.rb

14 lines
299 B
Ruby
Raw Normal View History

# 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