demarches-normaliennes/app/jobs/cron/expired_prefilled_dossiers_deletion_job.rb
2024-08-22 09:26:48 +02:00

9 lines
271 B
Ruby

# frozen_string_literal: true
class Cron::ExpiredPrefilledDossiersDeletionJob < Cron::CronJob
self.schedule_expression = Expired.schedule_at(self)
def perform
Dossier.prefilled.state_brouillon.where(user_id: nil, updated_at: ..5.days.ago).destroy_all
end
end