From 80c1a1af2cd77e940e4d11c38e687348d9a10864 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Tue, 8 Oct 2024 11:31:02 +0200 Subject: [PATCH] Remove not used param --- app/controllers/administrateurs/procedures_controller.rb | 2 +- app/models/concerns/procedure_path_concern.rb | 2 +- spec/models/procedure_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/administrateurs/procedures_controller.rb b/app/controllers/administrateurs/procedures_controller.rb index 38a2fdf2e..b296b08eb 100644 --- a/app/controllers/administrateurs/procedures_controller.rb +++ b/app/controllers/administrateurs/procedures_controller.rb @@ -286,7 +286,7 @@ module Administrateurs flash.alert = "La date limite de dépôt des dossiers doit être postérieure à la date du jour pour réactiver la procédure. #{view_context.link_to('Veuillez la modifier', edit_admin_procedure_path(@procedure))}" redirect_to admin_procedure_path(@procedure) else - @procedure.path = @procedure.suggested_path(current_administrateur) + @procedure.path = @procedure.suggested_path @current_administrateur = current_administrateur @closed_procedures = current_administrateur.procedures.with_discarded.closes.map { |p| ["#{p.libelle} (#{p.id})", p.id] }.to_h end diff --git a/app/models/concerns/procedure_path_concern.rb b/app/models/concerns/procedure_path_concern.rb index 9c983eab5..878a66593 100644 --- a/app/models/concerns/procedure_path_concern.rb +++ b/app/models/concerns/procedure_path_concern.rb @@ -29,7 +29,7 @@ module ProcedurePathConcern !path.match?(/[[:xdigit:]]{8}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12}/) end - def suggested_path(administrateur) + def suggested_path if path_customized? return path end diff --git a/spec/models/procedure_spec.rb b/spec/models/procedure_spec.rb index 50db50eb1..51d11ce8f 100644 --- a/spec/models/procedure_spec.rb +++ b/spec/models/procedure_spec.rb @@ -1365,7 +1365,7 @@ describe Procedure do describe 'suggested_path' do let(:procedure) { create(:procedure, aasm_state: :publiee, libelle: 'Inscription au Collège', zones: [create(:zone)]) } - subject { procedure.suggested_path(procedure.administrateurs.first) } + subject { procedure.suggested_path } context 'when the path has been customized' do before { procedure.path = 'custom_path' }