Improve a task

This commit is contained in:
gregoirenovel 2018-06-07 17:25:39 +02:00
parent 4db432a4ca
commit 96a4ebd860

View file

@ -33,12 +33,18 @@ namespace :'2018_06_05_send_new_attestation' do
dossiers.each do |dossier|
attestation = dossier.attestation
attestation.destroy
if attestation
id = attestation.id
attestation.destroy
puts "Attestation #{id} détruite"
end
dossier.attestation = dossier.build_attestation
NewAttestationMailer.new_attestation(dossier).deliver_later
puts "Email envoyé à #{email} pour le dossier #{dossier.id}"
puts
end
end
end