Class: Tasks::AddSpikedInControlHandler::Handler

Inherits:
BaseHandler
  • Object
show all
Defined in:
app/models/tasks/add_spiked_in_control_handler.rb

Overview

The handler takes the parameters for the task and helps add the scanned Spiked PhiX as a parent of each lane

Instance Attribute Summary

Attributes inherited from BaseHandler

#controller, #params, #task, #user

Instance Method Summary collapse

Methods inherited from BaseHandler

#initialize

Constructor Details

This class inherits a constructor from Tasks::BaseHandler

Instance Method Details

#performObject



8
9
10
11
12
13
14
15
# File 'app/models/tasks/add_spiked_in_control_handler.rb', line 8

def perform
  # Rubocop gets in a fight with prettier here.
  if missing_barcodes.present?
    return false, "Can't find a spiked hybridization buffer with barcode #{missing_barcodes.to_sentence}"
  end

  Batch.transaction { add_control ? create_batch_events : false }
end