Add the possibility to disable weekly email notifications (instructeur) && rename the column email_notifications_enabled to daily_email_notification_enabled
This commit is contained in:
parent
35b608fb7d
commit
0b8a59d5e9
6 changed files with 33 additions and 8 deletions
|
@ -75,11 +75,12 @@ class Instructeur < ApplicationRecord
|
|||
start_date = Time.zone.now.beginning_of_week
|
||||
|
||||
active_procedure_overviews = procedures
|
||||
.where(assign_tos: { weekly_email_notifications_enabled: true })
|
||||
.publiees
|
||||
.map { |procedure| procedure.procedure_overview(start_date, groupe_instructeurs) }
|
||||
.filter(&:had_some_activities?)
|
||||
|
||||
if active_procedure_overviews.count == 0
|
||||
if active_procedure_overviews.empty?
|
||||
nil
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue