Further refactor of AutoArchiveProcedureWorker
Call received! so that validation and save callbacks are called. Previously, we wouldn’t have update the received_at date
This commit is contained in:
parent
cc95216672
commit
67d0fb5ddc
1 changed files with 3 additions and 1 deletions
|
@ -3,7 +3,9 @@ class AutoArchiveProcedureWorker
|
||||||
|
|
||||||
def perform(*args)
|
def perform(*args)
|
||||||
Procedure.not_archived.where("auto_archive_on <= ?", Date.today).each do |procedure|
|
Procedure.not_archived.where("auto_archive_on <= ?", Date.today).each do |procedure|
|
||||||
procedure.dossiers.state_en_construction.update_all(state: :received)
|
procedure.dossiers.state_en_construction.each do |dossier|
|
||||||
|
dossier.received!
|
||||||
|
end
|
||||||
|
|
||||||
procedure.update_attributes!(archived: true)
|
procedure.update_attributes!(archived: true)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue