Module: SampleManifest::CoreBehaviour::StockAssets

Included in:
PlateBehaviour::Core, SampleTubeBehaviour::Core
Defined in:
app/models/sample_manifest/core_behaviour.rb

Instance Method Summary collapse

Instance Method Details

#generate_sample_and_aliquot(sanger_sample_id, receptacle) ⇒ Object


32
33
34
35
36
37
38
# File 'app/models/sample_manifest/core_behaviour.rb', line 32

def generate_sample_and_aliquot(sanger_sample_id, receptacle)
  create_sample(sanger_sample_id).tap do |sample|
    receptacle.aliquots.create!(sample: sample, study: study)
    receptacle.register_stock!
    study.samples << sample
  end
end