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
|
end
|
||||||
|
|
||||||
def export_mail_brouillons
|
def export_mail_brouillons
|
||||||
dossiers = procedure.dossiers.state_brouillon
|
dossiers = procedure.dossiers.state_brouillon.includes(:user)
|
||||||
emails = dossiers.map { |d| d.user.email }.sort
|
emails = dossiers.map { |d| d.user.email }.sort.uniq
|
||||||
date = Time.zone.now.strftime('%d-%m-%Y')
|
date = Time.zone.now.strftime('%d-%m-%Y')
|
||||||
send_data(emails.join("\n"), :filename => "brouillons-#{procedure.id}-au-#{date}.csv")
|
send_data(emails.join("\n"), :filename => "brouillons-#{procedure.id}-au-#{date}.csv")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue