Class: BatchRequest

Inherits:
ApplicationRecord show all
Includes:
Api::BatchRequestIo::Extensions, Uuid::Uuidable
Defined in:
app/models/batch_request.rb

Overview

Join table linking Batch to Request Requests can be alocated a specific order by setting ‘position’. This is especially useful for determining Lane order for SequencingRequest.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods included from Api::BatchRequestIo::Extensions

included

Methods inherited from ApplicationRecord

alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Squishify

extended

Instance Attribute Details

#sorting_requests_within_batchObject Also known as: sorting_requests_within_batch?

Ensure that any requests that are added have a position that is unique and incremental in the batch, unless we’re moving them around in the batch, in which case we assume it’ll be valid.



19
20
21
# File 'app/models/batch_request.rb', line 19

def sorting_requests_within_batch
  @sorting_requests_within_batch
end

Instance Method Details

#move_to_position!(position) ⇒ Object



36
37
38
# File 'app/models/batch_request.rb', line 36

def move_to_position!(position)
  update!(sorting_requests_within_batch: true, position: position)
end