Class: BatchRequest
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- BatchRequest
- 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
-
#sorting_requests_within_batch ⇒ Object
(also: #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.
Instance Method Summary collapse
Methods included from Uuid::Uuidable
included, #unsaved_uuid!, #uuid
Methods included from Api::BatchRequestIo::Extensions
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
Instance Attribute Details
#sorting_requests_within_batch ⇒ Object 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 |