Class: FluidigmTemplateTask

Inherits:
PlateTemplateTask show all
Defined in:
app/models/fluidigm_template_task.rb

Instance Method Summary collapse

Methods inherited from PlateTemplateTask

#create_render_element, #do_task, #render_task

Methods inherited from Task

#create_render_element, #do_task, #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

#partialObject


2
3
4
# File 'app/models/fluidigm_template_task.rb', line 2

def partial
  'fluidigm_template_batches'
end

#plate_purpose_options(batch) ⇒ Object


6
7
8
9
10
11
# File 'app/models/fluidigm_template_task.rb', line 6

def plate_purpose_options(batch)
  requests       = batch.requests.flat_map(&:next_requests)
  plate_purposes = requests.map(&:request_type).compact.uniq.map(&:acceptable_plate_purposes).flatten.uniq
  plate_purposes = batch.requests.map { |r| r..target_purpose }.compact.uniq if plate_purposes.empty? # Fallback situation for the moment
  plate_purposes.map { |p| [p.name, p.size, p.id] }.sort
end