Class: Search::FindIlluminaCTubes

Inherits:
Search show all
Defined in:
app/models/search/find_illumina_c_tubes.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

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

Class Method Details

.illumina_c_final_tube_purposeObject


16
17
18
19
# File 'app/models/search/find_illumina_c_tubes.rb', line 16

def self.illumina_c_final_tube_purpose
  Tube::Purpose.where(name:
    IlluminaC::PlatePurposes::TUBE_PURPOSE_FLOWS.map(&:last))
end

.illumina_c_tube_purposesObject


10
11
12
13
# File 'app/models/search/find_illumina_c_tubes.rb', line 10

def self.illumina_c_tube_purposes
  Tube::Purpose.where(name:
    IlluminaC::PlatePurposes::TUBE_PURPOSE_FLOWS.flatten)
end

Instance Method Details

#scope(criteria) ⇒ Object


4
5
6
7
8
# File 'app/models/search/find_illumina_c_tubes.rb', line 4

def scope(criteria)
  # We find all plates that do not have transfers where they are the source.  Once a plate has been transferred (or marked
  # for transfer) the destination plate becomes the end of the chain.
  Tube.include_purpose.with_purpose(illumina_c_tube_purposes).with_no_outgoing_transfers.in_state(criteria['state']).without_finished_tubes(illumina_c_final_tube_purpose)
end