chore(procedure): remove duplicate code

This commit is contained in:
Paul Chavard 2023-04-19 13:00:37 +02:00
parent 7bf31c6278
commit 8904516b85
2 changed files with 1 additions and 10 deletions

View file

@ -219,7 +219,7 @@ module Administrateurs
def restore
procedure = current_administrateur.procedures.with_discarded.discarded.find(params[:id])
procedure.restore_procedure(current_administrateur)
procedure.restore(current_administrateur)
flash.notice = t('administrateurs.index.restored', procedure_id: procedure.id)
redirect_to admin_procedures_path
end

View file

@ -741,15 +741,6 @@ class Procedure < ApplicationRecord
end
end
def restore_procedure(author)
if discarded?
undiscard
self.dossiers.hidden_by_administration.each do |dossier|
dossier.restore(author)
end
end
end
def flipper_id
"Procedure;#{id}"
end