2018-06-13 17:32:50 +02:00
|
|
|
namespace :'2018_06_13_unhide_dossiers' do
|
|
|
|
task run: :environment do
|
2020-01-28 16:55:07 +01:00
|
|
|
Dossier.hidden.state_instruction_commencee.each do |d|
|
2018-06-13 17:32:50 +02:00
|
|
|
if !d.procedure.nil? # ensure the procedure was not deleted by administrateur for testing
|
|
|
|
d.update(hidden_at: nil)
|
|
|
|
DeletedDossier.find_by(dossier_id: d.id)&.destroy
|
|
|
|
DossierMailer.notify_unhide_to_user(d).deliver_later
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|