2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

💄 add username and date-time in exported file name

This commit is contained in:
Arpit Jalan 2015-01-15 23:00:59 +05:30
parent 14ea59b623
commit c619aed8f9
5 changed files with 21 additions and 12 deletions

View file

@ -15,7 +15,7 @@ class ExportCsvController < ApplicationController
def show
params.require(:id)
filename = params.fetch(:id)
export_id = filename.split('-')[2].split('.')[0]
export_id = filename.split('-')[-1].split('.')[0]
export_initiated_by_user_id = 0
export_initiated_by_user_id = UserExport.where(id: export_id)[0].user_id unless UserExport.where(id: export_id).empty?
export_csv_path = UserExport.get_download_path(filename)