Class: Event::LabwareFailedEvent

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

Overview

Labware failed event

Class Method Summary collapse

Methods inherited from Event

#request, #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

alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Squishify

extended

Class Method Details

.create_for_asset!(asset, failure_id, created_by) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'app/models/event/labware_failed_event.rb', line 8

def self.create_for_asset!(asset, failure_id, created_by)
  create!(
    eventful: asset,
    message: "Labware failed for reason: #{failure_id}",
    content: Time.zone.today.to_s,
    family: 'labware_failure',
    created_by: created_by
  )
end