Class: Sequent::Core::EventRecord

Inherits:
ApplicationRecord show all
Includes:
SerializesEvent
Defined in:
lib/sequent/core/event_record.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializesEvent

#event, #event=, included, #serialize_json?

Class Method Details

.find_by_event(event) ⇒ Object



112
113
114
# File 'lib/sequent/core/event_record.rb', line 112

def self.find_by_event(event)
  find_by(aggregate_id: event.aggregate_id, sequence_number: event.sequence_number)
end

Instance Method Details

#origin_commandObject Also known as: origin



116
117
118
# File 'lib/sequent/core/event_record.rb', line 116

def origin_command
  parent_command&.origin_command
end