Class: Tube::StandardMx

Inherits:
Purpose show all
Defined in:
app/models/tube/standard_mx.rb

Instance Method Summary collapse

Methods inherited from Purpose

#create!, #library_source_plates, #sibling_tubes, standard_library_tube, standard_mx_tube, standard_sample_tube, stock_library_tube, stock_mx_tube, #stock_plate

Methods inherited from Purpose

#barcode_type, #prefix=, #set_default_barcode_prefix, #source_plate, #target_class

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods included from Purpose::Relationship::Associations

included

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#transition_to(tube, state, _user, _ = nil, _customer_accepts_responsibility = false) ⇒ Object

Transitioning an MX library tube to a state involves updating the state of the transfer requests. If the state is anything but “started” or “pending” then the pulldown library creation request should also be set to the same state


6
7
8
9
10
11
12
13
14
15
# File 'app/models/tube/standard_mx.rb', line 6

def transition_to(tube, state, _user, _ = nil, _customer_accepts_responsibility = false)
  if update_all_requests?(state)
    tube.requests_as_target.opened.for_billing.each do |request|
      request.transition_to(state)
    end
  end
  tube.transfer_requests_as_target.each do |request|
    request.transition_to(state)
  end
end