Class: UatActions::TestSubmission

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

Overview

Will construct submissions Currently VERY basic

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

.compatible_submission_templatesObject


50
51
52
53
54
55
56
# File 'app/uat_actions/uat_actions/test_submission.rb', line 50

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

.defaultUatActions::TestSubmission

Returns a default copy of the UatAction which will be used to fill in the form

Returns:


46
47
48
# File 'app/uat_actions/uat_actions/test_submission.rb', line 46

def self.default
  new
end

Instance Method Details

#performBoolean

Generates a full plate submission for the given template

Returns:

  • (Boolean)

    Returns true if the action was successful, false otherwise


62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'app/uat_actions/uat_actions/test_submission.rb', line 62

def perform
  order = submission_template.create_with_submission!(
    study: study,
    project: project,
    user: user,
    assets: assets,
    request_options: order_request_options
  )
  report['plate_barcode_0'] = labware.human_barcode
  report['submission_id'] = order.submission.id
  report['library_type'] = order.request_options[:library_type] if order.request_options[:library_type].present?
  order.submission.built!
  true
end