Class: StateChanger::InitialStockTube

Inherits:
TubeBase show all
Defined in:
app/models/state_changer/initial_stock_tube.rb

Overview

Handles the basic transitions of initial stock tubes within the library prep process

Constant Summary collapse

TERMINATED_STATES =
%w[cancelled failed].freeze

Instance Attribute Summary

Attributes inherited from Base

#labware, #user

Instance Method Summary collapse

Methods inherited from TubeBase

#update_labware_state

Methods inherited from Base

#associated_request_target_state, #contents, #customer_accepts_responsibility, #map_target_state_to_associated_request_state, #target_state, #update_labware_state

Instance Method Details

#update_associated_requestsObject



15
16
17
18
19
20
# File 'app/models/state_changer/initial_stock_tube.rb', line 15

def update_associated_requests
  associated_requests.each do |request|
    request.customer_accepts_responsibility! if customer_accepts_responsibility
    request.transition_to(associated_request_target_state) if valid_transition?(request)
  end
end