cleanup(dossier): remove unused forks
This commit is contained in:
parent
7c4edf882e
commit
737c1a9faa
2 changed files with 41 additions and 0 deletions
18
app/tasks/maintenance/t20241202remove_unused_forks_task.rb
Normal file
18
app/tasks/maintenance/t20241202remove_unused_forks_task.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
# 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
|
Loading…
Add table
Add a link
Reference in a new issue