2020-03-26 17:37:55 +01:00
|
|
|
class DiscardedProceduresDeletionJob < CronJob
|
2020-04-01 15:26:46 +02:00
|
|
|
self.schedule_expression = "every day at 1 am"
|
2020-03-26 17:37:55 +01:00
|
|
|
|
|
|
|
def perform(*args)
|
|
|
|
Procedure.discarded_expired.find_each do |procedure|
|
|
|
|
procedure.dossiers.with_discarded.destroy_all
|
|
|
|
procedure.destroy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|