Rename CsvExportLog to UserExport

This commit is contained in:
Arpit Jalan
2014-12-28 21:43:49 +05:30
parent 8d03ff6f82
commit 68e66f3a25
6 changed files with 28 additions and 23 deletions

View File

@ -19,8 +19,8 @@ class ExportCsvController < ApplicationController
filename = params.fetch(:id)
export_id = filename.split('_')[1].split('.')[0]
export_initiated_by_user_id = 0
export_initiated_by_user_id = CsvExportLog.where(id: export_id)[0].user_id unless CsvExportLog.where(id: export_id).empty?
export_csv_path = CsvExportLog.get_download_path(filename)
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)
if export_csv_path && export_initiated_by_user_id == current_user.id
send_file export_csv_path