Class: AddSpikedInControlTask

Inherits:
Task show all
Defined in:
app/models/add_spiked_in_control_task.rb

Overview

A Task used in the sequencing pipelines. Associates a tube of SpikedBuffer with a Lane indicating that PhiX has been added to the lane in question.

Instance Method Summary collapse

Methods inherited from Task

#create_render_element, #find_batch, #find_batch_requests, #get_descriptor_value, #get_subclass_attribute_options, get_subclass_attribute_options, #get_subclass_attribute_value, get_subclass_attributes, #get_subclass_attributes, #included_for_do_task, #included_for_render_task, init_class, #render_task, #set_descriptor_value, set_subclass_attribute, #set_subclass_attribute_value, #sub_events_for

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#add_control(batch, control_asset, request_id_set) ⇒ Object


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/models/add_spiked_in_control_task.rb', line 16

def add_control(batch, control_asset, request_id_set)
  return false unless batch && control_asset

  batch.requests.each do |request|
    next unless request_id_set.include? request.id

    lane = request.target_asset.labware
    next unless lane

    AssetLink.create_edge(control_asset, lane)
  end

  control_asset.save!
  true
end

#do_task(controller, params) ⇒ Object


12
13
14
# File 'app/models/add_spiked_in_control_task.rb', line 12

def do_task(controller, params)
  controller.do_add_spiked_in_control_task(self, params)
end

#partialObject


8
9
10
# File 'app/models/add_spiked_in_control_task.rb', line 8

def partial
  'add_spiked_in_control'
end