Module: WorkCompletionBehaviour

Extended by:
ActiveSupport::Concern
Included in:
Plates::WorkCompletionsController, Tubes::WorkCompletionsController
Defined in:
app/controllers/concerns/work_completion_behaviour.rb

Overview

Module WorkCompletionBehaviour provides work completion endpoints for controllers

Author:

  • Genome Research Ltd.

Instance Method Summary collapse

Instance Method Details

#createObject

Create a work completion for the given limber_plate_id and redirect to the plate page. Work completions mark library creation requests as completed and hook them up to the correct wells.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/concerns/work_completion_behaviour.rb', line 17

def create
  api.work_completion.create!(
    # Our pools keys are our submission uuids.
    submissions: labware.in_progress_submission_uuids,
    target: labware.uuid,
    user: current_user_uuid
  )

  # We assign the message in an array as create_submission may wish to add
  # its own feedback.
  flash[:notice] = ['Requests have been passed']

  create_submission if params[:sequencescape_submission]

  redirect_to labware
end

#sequencescape_submission_parametersObject



34
35
36
37
38
39
# File 'app/controllers/concerns/work_completion_behaviour.rb', line 34

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