Task to unhide dossiers with instruction commencee
This commit is contained in:
parent
89f82ba92e
commit
ae6e3e345e
4 changed files with 32 additions and 0 deletions
11
lib/tasks/2018_06_13_unhide_dossiers.rake
Normal file
11
lib/tasks/2018_06_13_unhide_dossiers.rake
Normal file
|
@ -0,0 +1,11 @@
|
|||
namespace :'2018_06_13_unhide_dossiers' do
|
||||
task run: :environment do
|
||||
Dossier.unscoped.where.not(hidden_at: nil).state_instruction_commencee.each do |d|
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue