[Fix #658] when dossier linked to avis is hidden, do not crash application
This commit is contained in:
parent
116398d9d8
commit
dd1fea78ac
3 changed files with 13 additions and 1 deletions
|
@ -6,6 +6,7 @@ class Avis < ApplicationRecord
|
|||
before_create :try_to_assign_gestionnaire
|
||||
after_create :notify_gestionnaire
|
||||
|
||||
default_scope { joins(:dossier) }
|
||||
scope :with_answer, -> { where.not(answer: nil) }
|
||||
scope :without_answer, -> { where(answer: nil) }
|
||||
scope :for_dossier, ->(dossier_id) { where(dossier_id: dossier_id) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue