Class: FluidigmTemplateTask
- Inherits:
-
PlateTemplateTask
- Object
- ActiveRecord::Base
- ApplicationRecord
- Task
- PlateTemplateTask
- FluidigmTemplateTask
- Defined in:
- app/models/fluidigm_template_task.rb
Instance Method Summary collapse
- #partial ⇒ Object
-
#plate_purpose_options(batch) ⇒ Object
rubocop:todo Metrics/AbcSize.
Methods inherited from PlateTemplateTask
Methods inherited from Task
#can_link_directly?, #can_process?, #do_task, #included_for_do_task, #included_for_render_task, #render_task
Methods inherited from ApplicationRecord
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
Instance Method Details
#partial ⇒ Object
3 4 5 |
# File 'app/models/fluidigm_template_task.rb', line 3 def partial 'fluidigm_template_batches' end |
#plate_purpose_options(batch) ⇒ Object
rubocop:todo Metrics/AbcSize
7 8 9 10 11 12 13 14 15 |
# File 'app/models/fluidigm_template_task.rb', line 7 def (batch) # rubocop:todo Metrics/AbcSize next_requests = batch.requests.flat_map(&:next_requests) plate_purposes = next_requests.filter_map(&:request_type).uniq.map(&:acceptable_purposes).flatten.uniq # If downstream requests don't specify an acceptable_purpose, fallback to any target purposes # on the current requests plate_purposes = batch.requests.filter_map { |r| r..target_purpose }.uniq if plate_purposes.empty? plate_purposes.map { |p| [p.name, p.size, p.id] }.sort end |