Module: SequencescapeSubmissionBehaviour

Included in:
SequencescapeSubmissionsController
Defined in:
app/controllers/concerns/sequencescape_submission_behaviour.rb

Overview

Module SequencescapeSubmissionBehaviour provides the ability to generate submissions to controllers

Author:

  • Genome Research Ltd.

Instance Method Summary collapse

Instance Method Details

#create_submissionObject

Builds a submission using the supplied params



10
11
12
13
14
15
16
17
18
# File 'app/controllers/concerns/sequencescape_submission_behaviour.rb', line 10

def create_submission
  ss = SequencescapeSubmission.new(sequencescape_submission_parameters)
  if ss.save
    flash[:notice] ||= []
    flash[:notice] << 'Your submissions have been made and should be built shortly.'
  else
    flash[:alert] = truncate_flash(ss.errors.full_messages)
  end
end

#sequencescape_submission_parametersObject



20
21
22
23
24
25
# File 'app/controllers/concerns/sequencescape_submission_behaviour.rb', line 20

def sequencescape_submission_parameters
  params
    .require(:sequencescape_submission)
    .permit(:template_uuid, :labware_barcode, request_options: {}, assets: [], asset_groups: {}, extra_barcodes: [])
    .merge(api: api, user: current_user_uuid)
end