Improve a task
This commit is contained in:
parent
4db432a4ca
commit
96a4ebd860
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue