From e8b10fd3201a5b66af2b3d77b061d5e3f0632a38 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Fri, 6 Jan 2023 11:00:42 +0100 Subject: [PATCH] fix(procedure): return most recent demarche for a given path --- app/controllers/users/commencer_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users/commencer_controller.rb b/app/controllers/users/commencer_controller.rb index c416c98f8..f8fa38aed 100644 --- a/app/controllers/users/commencer_controller.rb +++ b/app/controllers/users/commencer_controller.rb @@ -75,7 +75,7 @@ module Users end def retrieve_procedure_with_closed - Procedure.publiees.or(Procedure.brouillons).or(Procedure.closes).find_by(path: params[:path]) + Procedure.publiees.or(Procedure.brouillons).or(Procedure.closes).order(published_at: :desc).find_by(path: params[:path]) end def retrieve_prefilled_dossier