Class: Dradis::Plugins::CSV::UploadController

Inherits:
AuthenticatedController
  • Object
show all
Includes:
ProjectScoped
Defined in:
app/controllers/dradis/plugins/csv/upload_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/dradis/plugins/csv/upload_controller.rb', line 15

def create
  job_logger.write 'Enqueueing job to start in the background.'

  MappingImportJob.perform_later(
    default_user_id: current_user.id,
    file: @attachment.fullpath.to_s,
    mappings: mappings_params[:field_attributes].to_h,
    project_id: current_project.id,
    uid: params[:log_uid].to_i
  )
end

#newObject



9
10
11
12
13
# File 'app/controllers/dradis/plugins/csv/upload_controller.rb', line 9

def new
  @default_columns = ['Column Header', 'Entity', 'Dradis Field']

  @log_uid = Log.new.uid
end