Class: Fosm::TransitionLog
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Fosm::TransitionLog
- Defined in:
- app/models/fosm/transition_log.rb
Overview
Immutable audit trail of every FOSM state transition. Records are never updated or deleted — this is an append-only log. Supports optional state snapshots for efficient replay and audit.
Instance Method Summary collapse
- #by_agent? ⇒ Boolean
- #by_human? ⇒ Boolean
-
#snapshot? ⇒ Boolean
Returns true if this log entry includes a state snapshot.
Instance Method Details
#by_agent? ⇒ Boolean
25 26 27 |
# File 'app/models/fosm/transition_log.rb', line 25 def by_agent? actor_type == "symbol" && actor_label == "agent" end |
#by_human? ⇒ Boolean
29 30 31 |
# File 'app/models/fosm/transition_log.rb', line 29 def by_human? !by_agent? && actor_id.present? end |
#snapshot? ⇒ Boolean
Returns true if this log entry includes a state snapshot
34 35 36 |
# File 'app/models/fosm/transition_log.rb', line 34 def snapshot? state_snapshot.present? end |