From 480a6d822c5110167d59adee6972083d2e50c64c Mon Sep 17 00:00:00 2001 From: yoldas Date: Tue, 11 Jul 2023 15:13:08 +0100 Subject: [PATCH] Added comments for stock plate fallbacks --- app/models/labels/plate_384_single_label.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/labels/plate_384_single_label.rb b/app/models/labels/plate_384_single_label.rb index d1c102ada..ed8e70997 100644 --- a/app/models/labels/plate_384_single_label.rb +++ b/app/models/labels/plate_384_single_label.rb @@ -19,16 +19,21 @@ def workline_identifier # Returns stock plate with fallbacks def workline_reference + # Find the plates with configured purpose (using alternative_workline_identifier setting) and return the first. plate = first_of_configured_purpose return plate if plate.present? + # Check if the labware itself is a stock plate (using input_plate setting) and return the labware. return labware if labware.stock_plate?(purpose_names: SearchHelper.stock_plate_names) + # Check if the labware itself is a stock plate (using stock_plate setting) and return the labware. return labware if labware.stock_plate?(purpose_names: SearchHelper.stock_plate_names_with_flag) + # Find the plates of the last purpose (using input_plate setting) and return the first. plate = first_of_last_purpose(SearchHelper.stock_plate_names) return plate if plate.present? + # Find the plates of last purpose (using stock_plate setting) and return the first. first_of_last_purpose(SearchHelper.stock_plate_names_with_flag) end