demarches-normaliennes/app/jobs/cron/expired_prefilled_dossiers_deletion_job.rb

8 lines
234 B
Ruby
Raw Normal View History

class Cron::ExpiredPrefilledDossiersDeletionJob < Cron::CronJob
self.schedule_expression = "every day at 3:00"
def perform
Dossier.prefilled.state_brouillon.where(user_id: nil, updated_at: ..5.days.ago).destroy_all
end
end