Add commencer/test/:procedure_path route

This commit is contained in:
Paul Chavard 2018-05-17 15:34:51 +02:00
parent ffef1a644c
commit 94d253c6dc
6 changed files with 45 additions and 30 deletions

View file

@ -63,11 +63,6 @@ class Admin::ProceduresController < AdminController
def hide
procedure = current_administrateur.procedures.find(params[:id])
procedure.hide!
# procedure should no longer be reachable so we delete its procedure_path
# that way it is also available for another procedure
# however, sometimes the path has already been deleted (ex: stolen by another procedure),
# so we're not certain the procedure has a procedure_path anymore
procedure.procedure_path.try(:destroy)
flash.notice = "Procédure supprimée, en cas d'erreur contactez nous : contact@demarches-simplifiees.fr"
redirect_to admin_procedures_draft_path