Notification: add gestionnaire.procedures_with_email_notifications scope
This commit is contained in:
parent
7077153e7e
commit
1644fd9059
4 changed files with 13 additions and 1 deletions
|
@ -3,6 +3,8 @@ class AssignTo < ApplicationRecord
|
|||
belongs_to :gestionnaire
|
||||
has_one :procedure_presentation, dependent: :destroy
|
||||
|
||||
scope :with_email_notifications, -> { where(email_notifications_enabled: true) }
|
||||
|
||||
def procedure_presentation_or_default_and_errors
|
||||
errors = reset_procedure_presentation_if_invalid
|
||||
[procedure_presentation || build_procedure_presentation, errors]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue