do not display confidential avis to other experts

This commit is contained in:
kara Diaby 2021-05-19 15:41:12 +02:00
parent 8134fa389c
commit 20933579b0

View file

@ -535,14 +535,10 @@ 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))
.order(created_at: :asc)
end
Avis
.where(dossier_id: id, confidentiel: false)
.or(Avis.where(id: expert.avis))
.order(created_at: :asc)
end
def owner_name