Add a method to retrieve all invited experts for all procedure dossiers
This commit is contained in:
parent
e63f93f8de
commit
2b06ee95e1
2 changed files with 52 additions and 0 deletions
|
@ -56,6 +56,16 @@ class Avis < ApplicationRecord
|
|||
Avis.find_by(id: avis_id)&.email == email
|
||||
end
|
||||
|
||||
def self.invited_expert_emails(procedure)
|
||||
Avis
|
||||
.joins(dossier: :revision)
|
||||
.left_joins(instructeur: :user)
|
||||
.where(procedure_revisions: { procedure_id: procedure })
|
||||
.map(&:email_to_display)
|
||||
.uniq
|
||||
.sort
|
||||
end
|
||||
|
||||
def spreadsheet_columns
|
||||
[
|
||||
['Dossier ID', dossier_id.to_s],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue