2013-02-05 14:16:51 -05:00
|
|
|
class Admin::ExportController < Admin::AdminController
|
|
|
|
def create
|
2013-03-04 19:42:44 -05:00
|
|
|
unless Export.is_export_running? || Import.is_import_running?
|
2013-02-05 14:16:51 -05:00
|
|
|
job_id = Jobs.enqueue( :exporter, user_id: current_user.id )
|
|
|
|
render json: success_json.merge( job_id: job_id )
|
|
|
|
else
|
2013-04-07 12:14:50 -04:00
|
|
|
render json: failed_json.merge( message: I18n.t('operation_already_running', { operation: Export.is_export_running? ? 'export' : 'import' }))
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
end
|
2013-02-07 10:45:24 -05:00
|
|
|
end
|