Class: SampleManifestAsset
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- SampleManifestAsset
- Defined in:
- app/models/sample_manifest_asset.rb
Overview
Keeps track of sanger_sample_ids which have been allocated to a SampleManifest and associates them with the corresponding Receptacle
Instance Method Summary collapse
- #aliquot ⇒ Object
-
#find_or_create_sample ⇒ Object
Returns the existing sample, or generates a new one if it doesn't exist.
Methods inherited from ApplicationRecord
convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
Methods included from Warren::BroadcastMessages
#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren
Instance Method Details
#aliquot ⇒ Object
23 24 25 |
# File 'app/models/sample_manifest_asset.rb', line 23 def aliquot asset.aliquots.detect { |a| a.sample_id == sample.id } end |
#find_or_create_sample ⇒ Object
Returns the existing sample, or generates a new one if it doesn't exist
19 20 21 |
# File 'app/models/sample_manifest_asset.rb', line 19 def find_or_create_sample self.sample ||= create_sample end |