Class: UatActions::GenerateSampleManifest
- Inherits:
-
UatActions
- Object
- UatActions
- UatActions::GenerateSampleManifest
show all
- Defined in:
- app/uat_actions/uat_actions/generate_sample_manifest.rb
Overview
Will construct a sample manifest
Constant Summary
Constants inherited
from UatActions
CATEGORY_LIST
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from UatActions
all, category, find, form_field, form_fields, #form_fields, grouped_and_sorted_uat_actions, id, inherited, permitted, #report, #save, to_partial_path, uat_actions
Instance Method Details
#create_sample_manifest ⇒ Object
62
63
64
|
# File 'app/uat_actions/uat_actions/generate_sample_manifest.rb', line 62
def create_sample_manifest
SampleManifest.create!(study:, supplier:, asset_type:, count:, purpose:)
end
|
#create_samples(sample_manifest) ⇒ Object
71
72
73
74
75
76
77
78
79
80
|
# File 'app/uat_actions/uat_actions/generate_sample_manifest.rb', line 71
def create_samples(sample_manifest)
sample_manifest.assets.each do |asset|
raise 'Manifest for plates is not supported yet' unless asset_type == '1dtube'
create_sample("Sample_#{asset.human_barcode}_1", sample_manifest).tap do |sample|
asset.aliquots.create!(sample:, study:)
study.samples << sample
end
end
end
|
#generate_manifest(sample_manifest) ⇒ Object
66
67
68
69
|
# File 'app/uat_actions/uat_actions/generate_sample_manifest.rb', line 66
def generate_manifest(sample_manifest)
sample_manifest.generate
create_samples(sample_manifest) if with_samples == '1'
end
|
54
55
56
57
58
59
60
|
# File 'app/uat_actions/uat_actions/generate_sample_manifest.rb', line 54
def perform
sample_manifest = create_sample_manifest
generate_manifest(sample_manifest)
print_report(sample_manifest)
true
end
|