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
Instance Method Summary collapse
-
#create_submission ⇒ Object
Builds a submission using the supplied params.
- #sequencescape_submission_parameters ⇒ Object
Instance Method Details
#create_submission ⇒ Object
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.) end end |
#sequencescape_submission_parameters ⇒ Object
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 |