feat(routing): can change defaut groupe
This commit is contained in:
parent
95ab81fd1c
commit
b38470368b
5 changed files with 51 additions and 1 deletions
|
@ -12,6 +12,11 @@ module Administrateurs
|
|||
groupe_instructeur.update!(routing_rule: ds_eq(left, right))
|
||||
end
|
||||
|
||||
def update_defaut_groupe_instructeur
|
||||
new_defaut = @procedure.groupe_instructeurs.find(defaut_groupe_instructeur_id)
|
||||
@procedure.update!(defaut_groupe_instructeur: new_defaut)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def targeted_champ_changed?
|
||||
|
@ -34,8 +39,12 @@ module Administrateurs
|
|||
routing_params[:groupe_instructeur_id]
|
||||
end
|
||||
|
||||
def defaut_groupe_instructeur_id
|
||||
routing_params[:defaut_groupe_instructeur_id]
|
||||
end
|
||||
|
||||
def routing_params
|
||||
params.permit(:targeted_champ, :value, :groupe_instructeur_id)
|
||||
params.permit(:targeted_champ, :value, :groupe_instructeur_id, :defaut_groupe_instructeur_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue