do not display confidential avis to other experts
This commit is contained in:
parent
8134fa389c
commit
20933579b0
1 changed files with 4 additions and 8 deletions
|
@ -535,15 +535,11 @@ class Dossier < ApplicationRecord
|
|||
end
|
||||
|
||||
def avis_for_expert(expert)
|
||||
if expert.dossiers.include?(self)
|
||||
avis.order(created_at: :asc)
|
||||
else
|
||||
avis
|
||||
.where(confidentiel: false)
|
||||
.or(avis.where(claimant: expert))
|
||||
Avis
|
||||
.where(dossier_id: id, confidentiel: false)
|
||||
.or(Avis.where(id: expert.avis))
|
||||
.order(created_at: :asc)
|
||||
end
|
||||
end
|
||||
|
||||
def owner_name
|
||||
if etablissement.present?
|
||||
|
|
Loading…
Reference in a new issue