unique emails + remove n+1
This commit is contained in:
parent
22a518c921
commit
8542fd9f47
1 changed files with 2 additions and 2 deletions
|
@ -40,8 +40,8 @@ module Manager
|
|||
end
|
||||
|
||||
def export_mail_brouillons
|
||||
dossiers = procedure.dossiers.state_brouillon
|
||||
emails = dossiers.map { |d| d.user.email }.sort
|
||||
dossiers = procedure.dossiers.state_brouillon.includes(:user)
|
||||
emails = dossiers.map { |d| d.user.email }.sort.uniq
|
||||
date = Time.zone.now.strftime('%d-%m-%Y')
|
||||
send_data(emails.join("\n"), :filename => "brouillons-#{procedure.id}-au-#{date}.csv")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue