update dossier after saving champ
update last_champ_updated_at without hook update last_champ_private_updated_at without hook Co-authored-by: Christophe Robillard <christophe.robillard@beta.gouv.fr>
This commit is contained in:
parent
b940d2e1b0
commit
c772c3454c
4 changed files with 74 additions and 16 deletions
|
@ -345,7 +345,11 @@ module Users
|
|||
errors = []
|
||||
|
||||
if champs_params[:dossier]
|
||||
if !@dossier.update(champs_params[:dossier])
|
||||
@dossier.assign_attributes(champs_params[:dossier])
|
||||
if @dossier.champs.any?(&:changed?)
|
||||
@dossier.last_champ_updated_at = Time.zone.now
|
||||
end
|
||||
if !@dossier.save
|
||||
errors += @dossier.errors.full_messages
|
||||
elsif change_groupe_instructeur?
|
||||
groupe_instructeur = @dossier.procedure.groupe_instructeurs.find(params[:dossier][:groupe_instructeur_id])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue