fix for files

This commit is contained in:
Harry Bomrah 2017-01-16 15:23:26 +08:00
parent 6b70f1672e
commit a4b587a86b
1 changed files with 2 additions and 1 deletions

View File

@ -156,7 +156,8 @@ wb.add_worksheet(name: "Annoucement") do |sheet|
row << t.join(";") row << t.join(";")
files = anns.bulletin_files.asc(:created_at) files = anns.bulletin_files.asc(:created_at)
t = files.collect{|f|"http://" + request.host_with_port + f.file.url} t = files.collect{|f|("http://" + request.host_with_port + f.file.url rescue nil)}
t.delete(nil)
row << t.join(";") row << t.join(";")
t = files.collect{|l|l.description_translations["en"]} t = files.collect{|l|l.description_translations["en"]}
row << t.join(";") row << t.join(";")