Module: Labware

Extended by:
ActiveSupport::Concern
Included in:
Plate, Tube
Defined in:
app/models/concerns/labware.rb

Overview

Material

Constant Summary collapse

ID_PREFIXES =

turn into constant as enum no longer works allows for a different prefix for each labware type

{ plate: 1, tube: 2 }.freeze

Instance Method Summary collapse

Instance Method Details

#generate_barcodeObject



23
24
25
26
27
# File 'app/models/concerns/labware.rb', line 23

def generate_barcode
  return if barcode.present?

  update(barcode: "TRAC-#{self.class.prefix}-#{id}")
end