demarches-normaliennes/app/jobs/warn_expiring_dossiers_job.rb
2018-09-20 17:44:31 +02:00

12 lines
313 B
Ruby

class WarnExpiringDossiersJob < ApplicationJob
queue_as :cron
def perform(*args)
expiring, expired = Dossier
.includes(:procedure)
.nearing_end_of_retention
.partition(&:retention_expired?)
AdministrationMailer.dossier_expiration_summary(expiring, expired).deliver_later
end
end