Class: Transfer

Inherits:
ApplicationRecord show all
Includes:
Uuid::Uuidable
Defined in:
app/models/transfer.rb

Overview

Note:

TransferRequestCollection is preferred, as it allows the client applications to control the transfer behaviour.

A transfer handles the transfer of material from one piece of labware to another. Different classes are used to determine exactly how the transfers are performed.

Defined Under Namespace

Modules: Associations, ControlledDestinations, State, TransfersBySchema, TransfersToKnownDestination Classes: BetweenPlateAndTubes, BetweenPlates, BetweenPlatesBySubmission, BetweenSpecificTubes, BetweenTubesBySubmission, FromPlateToSpecificTubes, FromPlateToSpecificTubesByPool, FromPlateToTube, FromPlateToTubeByMultiplex, FromPlateToTubeBySubmission

Class Method Summary collapse

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

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

Class Method Details

.preview!(attributes) ⇒ Object


28
29
30
31
32
33
34
35
36
37
# File 'app/models/transfer.rb', line 28

def self.preview!(attributes)
  new(attributes) do |transfer|
    raise ActiveRecord::RecordInvalid, transfer unless transfer.valid?

    transfer.unsaved_uuid!
    transfer.send(:each_transfer) do |source, destination|
      # Needs to do nothing at all as the transfers will be recorded
    end
  end
end