Class: UatActions::GenerateFluidxBarcodes
- Inherits:
-
UatActions
- Object
- UatActions
- UatActions::GenerateFluidxBarcodes
- Defined in:
- app/uat_actions/uat_actions/generate_fluidx_barcodes.rb
Overview
UAT action to generate randomised FluidX barcodes in the following format:
Sequential tail in barcodes may be higher and may have gaps because of handling duplicates. Random part may be truncated from right to fit the length of the barcode.
Class Method Summary collapse
-
.default ⇒ UatActions::GenerateFluidxBarcodes
Returns a default copy of the UatAction which will be used to fill in the form.
Instance Method Summary collapse
-
#perform ⇒ Boolean
This method is called from the save method after validations have passed.
Class Method Details
.default ⇒ UatActions::GenerateFluidxBarcodes
Returns a default copy of the UatAction which will be used to fill in the form.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'app/uat_actions/uat_actions/generate_fluidx_barcodes.rb', line 94 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. include ProjectManager::Associations include BudgetDivision::Associations custom_attribute(:project_cost_code, required: true) custom_attribute(:funding_comments) custom_attribute(:collaborators) custom_attribute(:external_funding_source) custom_attribute(:sequencing_budget_cost_centre) custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS) custom_attribute(:gt_committee_tracking_id) before_validation do |record| record.project_cost_code = nil if record.project_cost_code.blank? record.project_funding_model = nil if record.project_funding_model.blank? end end |
Instance Method Details
#perform ⇒ Boolean
This method is called from the save method after validations have passed. If the return value is true, the report hash populated by the action is used for rendering the response. If the return value is false, the errors collection is used.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'app/uat_actions/uat_actions/generate_fluidx_barcodes.rb', line 79 do # NOTE: The following attribute is not required for Microarray Genotyping. # I think this might be broken and suggests that there should be separate classes for project: one for # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping # that doesn't. include ProjectManager::Associations include BudgetDivision::Associations custom_attribute(:project_cost_code, required: true) custom_attribute(:funding_comments) custom_attribute(:collaborators) custom_attribute(:external_funding_source) custom_attribute(:sequencing_budget_cost_centre) custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS) custom_attribute(:gt_committee_tracking_id) before_validation do |record| record.project_cost_code = nil if record.project_cost_code.blank? record.project_funding_model = nil if record.project_funding_model.blank? end end |