Class: UatActions::TestSubmission
- Inherits:
-
UatActions
- Object
- UatActions
- UatActions::TestSubmission
- Defined in:
- app/uat_actions/uat_actions/test_submission.rb
Overview
Will construct submissions Currently VERY basic
Class Method Summary collapse
- .compatible_submission_templates ⇒ Object
-
.default ⇒ UatActions::TestSubmission
Returns a default copy of the UatAction which will be used to fill in the form.
Instance Method Summary collapse
-
#perform ⇒ Boolean
Generates a plate submission for the given template.
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
.compatible_submission_templates ⇒ Object
74 75 76 77 78 79 80 |
# File 'app/uat_actions/uat_actions/test_submission.rb', line 74 def self.compatible_submission_templates SubmissionTemplate.visible.each_with_object([]) do |submission_template, compatible| next unless submission_template.input_asset_type == 'Well' compatible << submission_template.name end end |
.default ⇒ UatActions::TestSubmission
Returns a default copy of the UatAction which will be used to fill in the form
70 71 72 |
# File 'app/uat_actions/uat_actions/test_submission.rb', line 70 def self.default new end |
Instance Method Details
#perform ⇒ Boolean
Generates a plate submission for the given template. A partial submission is possible if the number_of_wells_to_submit form field has been set.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'app/uat_actions/uat_actions/test_submission.rb', line 87 def perform order = submission_template.create_with_submission!( study: study, project: project, user: user, assets: assets, request_options: ) report['plate_barcode_0'] = labware. report['submission_id'] = order.submission.id report['library_type'] = order.[:library_type] if order.[:library_type].present? report['primer_panel'] = order.[:primer_panel_name] if order.[:primer_panel_name].present? report['number_of_wells_with_samples'] = labware.wells.with_aliquots.size report['number_of_wells_to_submit'] = assets.size order.submission.built! true end |