Module: Labware
- Extended by:
- ActiveSupport::Concern
- 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_barcode ⇒ Object
23 24 25 26 27 |
# File 'app/models/concerns/labware.rb', line 23 def return if .present? update(barcode: "TRAC-#{self.class.prefix}-#{id}") end |