Class: Event::SampleMetadataEvent
- Inherits:
-
Event
- Object
- ActiveRecord::Base
- ApplicationRecord
- Event
- Event::SampleMetadataEvent
- Defined in:
- app/models/event/sample_metadata_event.rb
Class Method Summary collapse
-
.updated_sample_metadata!(sample, attribute_changes, user) ⇒ Object
Indicates that the metadata associated with a sample has been updated.
Instance Method Summary collapse
Methods inherited from Event
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
Class Method Details
.updated_sample_metadata!(sample, attribute_changes, user) ⇒ Object
Indicates that the metadata associated with a sample has been updated. Usage example: sample.events.updated_sample_metadata!(attribute_changes, user)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/models/event/sample_metadata_event.rb', line 6 def self.(sample, attribute_changes, user) return if attribute_changes.empty? = 'Updated sample metadata' content = attribute_changes.to_json create!( eventful: sample, message: , content: content, family: 'sample_metadata', of_interest_to: 'administrators', created_by: user&.login ) end |
Instance Method Details
#to_partial_path ⇒ Object
22 23 24 |
# File 'app/models/event/sample_metadata_event.rb', line 22 def to_partial_path 'events/diff_event' end |