Notification: add methods to retrieve notifications
This commit is contained in:
parent
bb147bcb1f
commit
155a5f7826
7 changed files with 235 additions and 0 deletions
|
@ -12,6 +12,7 @@ class Avis < ApplicationRecord
|
|||
scope :without_answer, -> { where(answer: nil) }
|
||||
scope :for_dossier, ->(dossier_id) { where(dossier_id: dossier_id) }
|
||||
scope :by_latest, -> { order(updated_at: :desc) }
|
||||
scope :updated_since?, -> (date) { where('avis.updated_at > ?', date) }
|
||||
|
||||
def email_to_display
|
||||
gestionnaire.try(:email) || email
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue