demarches-normaliennes/app/jobs/discarded_procedures_deletion_job.rb
2020-03-31 17:08:28 +02:00

10 lines
257 B
Ruby

class DiscardedProceduresDeletionJob < CronJob
self.cron_expression = "0 7 * * *"
def perform(*args)
Procedure.discarded_expired.find_each do |procedure|
procedure.dossiers.with_discarded.destroy_all
procedure.destroy
end
end
end