Class: Implement Deprecated
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Implement
- Defined in:
- app/models/implement.rb
Overview
Deprecated.
This class doesn’t appear to have been used. Equipment appears to be a better choice.
Note:
JG: Almost certainly safe to just drop the table and remove this file.
Appears to have been intended to generate barcode for arbitrary instruments, beginning LE. Can’t see any entries in the production database, so assume this went unused. The Equipment table does have entries, and seems to perform an almost identical function
Constant Summary collapse
- @@barcode_prefix =
'LE'
Instance Method Summary collapse
- #barcode_prefix ⇒ Object
- #generate_barcode ⇒ Object
- #human_barcode ⇒ Object
- #save_and_generate_barcode ⇒ Object
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
#barcode_prefix ⇒ Object
19 20 21 |
# File 'app/models/implement.rb', line 19 def @@barcode_prefix end |
#generate_barcode ⇒ Object
12 13 14 15 16 17 |
# File 'app/models/implement.rb', line 12 def raise Exception.new, "Can't generate barcode with a null ID" if id == 0 b = Barcode.(, id) Barcode. b end |
#human_barcode ⇒ Object
23 24 25 |
# File 'app/models/implement.rb', line 23 def Barcode. end |
#save_and_generate_barcode ⇒ Object
27 28 29 30 31 32 |
# File 'app/models/implement.rb', line 27 def ActiveRecord::Base.transaction do save and self. = save end end |