Class: Tasks::Projects::DataController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Tasks::Projects::DataController
- Includes:
- TaskControllerConfiguration
- Defined in:
- app/controllers/tasks/projects/data_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
GET task/projects/data.
- #sql_download ⇒ Object
- #tsv_download ⇒ Object
Methods included from TaskControllerConfiguration
Instance Method Details
#index ⇒ Object
GET task/projects/data
5 6 7 8 9 10 11 12 |
# File 'app/controllers/tasks/projects/data_controller.rb', line 5 def index allowed_types = ['Download::ProjectDump::Tsv', 'Download::ProjectDump::Sql'] @project = Project.find(sessions_current_project_id) @recent_objects = Download.where(project_id: sessions_current_project_id, type: allowed_types) .order(created_at: :desc) .limit(10) end |
#sql_download ⇒ Object
14 15 16 17 18 |
# File 'app/controllers/tasks/projects/data_controller.rb', line 14 def sql_download custom_password = params[:custom_password].presence download = ::Export::ProjectData::Sql.download_async(sessions_current_project, custom_password: custom_password) redirect_to download_path(download) end |
#tsv_download ⇒ Object
20 21 22 23 |
# File 'app/controllers/tasks/projects/data_controller.rb', line 20 def tsv_download download = ::Export::ProjectData::Tsv.download_async(sessions_current_project) redirect_to file_download_path(download) end |