Skip to content

Commit

Permalink
Added comments for stock plate fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
yoldas committed Jul 11, 2023
1 parent fc26075 commit 480a6d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/labels/plate_384_single_label.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 480a6d8

Please sign in to comment.