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,14 +535,10 @@ class Dossier < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def avis_for_expert(expert)
|
def avis_for_expert(expert)
|
||||||
if expert.dossiers.include?(self)
|
Avis
|
||||||
avis.order(created_at: :asc)
|
.where(dossier_id: id, confidentiel: false)
|
||||||
else
|
.or(Avis.where(id: expert.avis))
|
||||||
avis
|
.order(created_at: :asc)
|
||||||
.where(confidentiel: false)
|
|
||||||
.or(avis.where(claimant: expert))
|
|
||||||
.order(created_at: :asc)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def owner_name
|
def owner_name
|
||||||
|
|
Loading…
Reference in a new issue