Class: UatActions::GenerateTagPlates

Inherits:
UatActions show all
Defined in:
app/uat_actions/uat_actions/generate_tag_plates.rb

Overview

Will construct plates with well_count wells filled with samples

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from UatActions

all, find, form_field, form_fields, #form_fields, id, inherited, permitted, #report, #save, to_partial_path, uat_actions

Class Method Details

.defaultObject


19
20
21
# File 'app/uat_actions/uat_actions/generate_tag_plates.rb', line 19

def self.default
  new(plate_count: 4)
end

Instance Method Details

#performObject


23
24
25
26
27
28
29
# File 'app/uat_actions/uat_actions/generate_tag_plates.rb', line 23

def perform
  qcc = QcableCreator.create!(lot: lot, user: user, count: plate_count.to_i)
  qcc.qcables.each_with_index do |qcable, index|
    qcable.update!(state: 'available')
    report["tag_plate_#{index}"] = qcable.asset.machine_barcode
  end
end