fix(instructeur): set notification settings on all groupe instruteur for given procedure
This commit is contained in:
parent
a180985fb7
commit
2f6cd317bf
1 changed files with 4 additions and 6 deletions
|
@ -216,11 +216,13 @@ module Instructeurs
|
|||
|
||||
def email_notifications
|
||||
@procedure = procedure
|
||||
@assign_to = assign_to
|
||||
@assign_to = assign_tos.first
|
||||
end
|
||||
|
||||
def update_email_notifications
|
||||
assign_to.update!(assign_to_params)
|
||||
assign_tos.each do |assign_to|
|
||||
assign_to.update!(assign_to_params)
|
||||
end
|
||||
flash.notice = 'Vos notifications sont enregistrées.'
|
||||
redirect_to instructeur_procedure_path(procedure)
|
||||
end
|
||||
|
@ -290,10 +292,6 @@ module Instructeurs
|
|||
@exports = Export.find_for_groupe_instructeurs(groupe_instructeur_ids)
|
||||
end
|
||||
|
||||
def assign_to
|
||||
current_instructeur.assign_to.joins(:groupe_instructeur).find_by(groupe_instructeurs: { procedure: procedure })
|
||||
end
|
||||
|
||||
def assign_tos
|
||||
@assign_tos ||= current_instructeur
|
||||
.assign_to
|
||||
|
|
Loading…
Add table
Reference in a new issue