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
convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
Methods included from Warren::BroadcastMessages
#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren
Instance Method Details
#barcode_prefix ⇒ Object
18 19 20 |
# File 'app/models/implement.rb', line 18 def @@barcode_prefix end |
#generate_barcode ⇒ Object
11 12 13 14 15 16 |
# File 'app/models/implement.rb', line 11 def raise Exception.new, "Can't generate barcode with a null ID" if id == 0 b = Barcode.(, id) Barcode. b end |
#human_barcode ⇒ Object
22 23 24 |
# File 'app/models/implement.rb', line 22 def Barcode. end |
#save_and_generate_barcode ⇒ Object
26 27 28 29 30 31 |
# File 'app/models/implement.rb', line 26 def ActiveRecord::Base.transaction do save and self. = save end end |