Class: Search::FindLotByBatchId
- Inherits:
-
Search
- Object
- ActiveRecord::Base
- ApplicationRecord
- Search
- Search::FindLotByBatchId
- Defined in:
- app/models/search/find_lot_by_batch_id.rb
Overview
Used by Gatekeeper to find the lot associated with a batch. Not used nowadays, as QC is no longer performed in house.
Instance Method Summary collapse
Methods included from Uuid::Uuidable
included, #unsaved_uuid!, #uuid
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
#parent_of_purpose(batch) ⇒ Object
10 11 12 13 14 15 |
# File 'app/models/search/find_lot_by_batch_id.rb', line 10 def parent_of_purpose(batch) input_labware = batch&.input_labware return nil if input_labware.empty? input_labware.first.ancestors.joins(:purpose).find_by(plate_purposes: { name: 'Tag PCR' }) end |