Class: UatActions::GeneratePrimerPanel

Inherits:
UatActions
  • Object
show all
Defined in:
app/uat_actions/uat_actions/generate_primer_panel.rb

Overview

Will construct a primer panel

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

.defaultUatActions::GeneratePrimerPanel

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

Returns:


44
45
46
# File 'app/uat_actions/uat_actions/generate_primer_panel.rb', line 44

def self.default
  new(snp_count: 48, pcr_1_name: 'Program 1', pcr_2_name: 'Program 2', pcr_1_duration: 60, pcr_2_duration: 60)
end

Instance Method Details

#performBoolean

perform description

Returns:

  • (Boolean)

    Returns true if the action was successful, false otherwise


52
53
54
55
56
57
58
59
60
61
# File 'app/uat_actions/uat_actions/generate_primer_panel.rb', line 52

def perform
  # Called by the controller once the form is filled in. Add your actual actions here.
  # All the form fields are accessible as simple attributes.
  # Return true if everything works
  report[:name] = name
  return true if existing_primer_panel

  primer_panel = PrimerPanel.create!(primer_panel_params)
  primer_panel.save
end