demarches-normaliennes/app/tasks/maintenance/t20241202remove_unused_forks_task.rb
2024-12-02 10:56:50 +01:00

18 lines
481 B
Ruby

# frozen_string_literal: true
module Maintenance
class T20241202removeUnusedForksTask < MaintenanceTasks::Task
# Documentation: Cette tâche supprime les forks laissés après le passage en instruction
include RunnableOnDeployConcern
include StatementsHelpersConcern
def collection
Dossier.joins(:editing_fork_origin).where.not(editing_fork_origin: { state: 'en_construction' })
end
def process(dossier)
dossier.destroy!
end
end
end