Module: Tasks::BindingKitBarcodeHandler

Included in:
WorkflowsController
Defined in:
app/models/tasks/binding_kit_barcode_handler.rb

Overview

Handles the behaviour of BindingKitBarcodeTask and included in WorkflowsController A Task used in PacBioSequencingPipeline Assigns a binding kit barcode to the PacBioLibraryTube

Instance Method Summary collapse

Instance Method Details

#do_binding_kit_barcode_task(task, params) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/models/tasks/binding_kit_barcode_handler.rb', line 7

def do_binding_kit_barcode_task(task, params)
  barcode = params[:binding_kit_barcode]
  if barcode.blank?
    flash[:error] = 'Please enter a Kit Barcode'
    return false
  end

  requests = task.find_batch_requests(params[:batch_id])
  ActiveRecord::Base.transaction do
    requests.each do |request|
      request..update!(binding_kit_barcode: barcode)
    end
  end

  true
end

#render_binding_kit_barcode_task(task, params) ⇒ Object


4
5
# File 'app/models/tasks/binding_kit_barcode_handler.rb', line 4

def render_binding_kit_barcode_task(task, params)
end