Class: Event::SampleManifestEvent

Inherits:
Event show all
Defined in:
app/models/event/sample_manifest_event.rb

Class Method Summary collapse

Methods inherited from Event

#request?

Methods included from RequestDescriptorUpdateEvent

included, #library_creation_descriptor?, #pass_or_fail_event?, #set_request_metadata, #update_metadata_for_request

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

.created_sample!(sample, user) ⇒ Object


2
3
4
5
6
7
8
9
10
# File 'app/models/event/sample_manifest_event.rb', line 2

def self.created_sample!(sample, user)
  create!(
    eventful: sample,
    message: 'Created by Sample Manifest',
    content: Date.today.to_s,
    family: 'created_sample_using_sample_manifest',
    created_by: user ? user. : nil
  )
end

.updated_sample!(sample, user) ⇒ Object


12
13
14
15
16
17
18
19
20
# File 'app/models/event/sample_manifest_event.rb', line 12

def self.updated_sample!(sample, user)
  create!(
    eventful: sample,
    message: 'Updated by Sample Manifest',
    content: Date.today.to_s,
    family: 'updated_sample_using_sample_manifest',
    created_by: user&.
  )
end