refactor(routing): extract configurate_routage_custom method
This commit is contained in:
parent
60ff785009
commit
70d9d72a59
1 changed files with 11 additions and 7 deletions
|
@ -86,6 +86,13 @@ module Administrateurs
|
||||||
|
|
||||||
def wizard
|
def wizard
|
||||||
if params[:choice][:state] == 'routage_custom'
|
if params[:choice][:state] == 'routage_custom'
|
||||||
|
configurate_routage_custom
|
||||||
|
elsif params[:choice][:state] == 'routage_simple'
|
||||||
|
redirect_to simple_routing_admin_procedure_groupe_instructeurs_path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def configurate_routage_custom
|
||||||
new_label = procedure.defaut_groupe_instructeur.label + ' bis'
|
new_label = procedure.defaut_groupe_instructeur.label + ' bis'
|
||||||
procedure.groupe_instructeurs
|
procedure.groupe_instructeurs
|
||||||
.create({ label: new_label, instructeurs: [current_administrateur.instructeur] })
|
.create({ label: new_label, instructeurs: [current_administrateur.instructeur] })
|
||||||
|
@ -93,9 +100,6 @@ module Administrateurs
|
||||||
procedure.toggle_routing
|
procedure.toggle_routing
|
||||||
|
|
||||||
redirect_to admin_procedure_groupe_instructeurs_path(procedure)
|
redirect_to admin_procedure_groupe_instructeurs_path(procedure)
|
||||||
elsif params[:choice][:state] == 'routage_simple'
|
|
||||||
redirect_to simple_routing_admin_procedure_groupe_instructeurs_path
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy_all_groups_but_defaut
|
def destroy_all_groups_but_defaut
|
||||||
|
|
Loading…
Reference in a new issue