Class: StateTransition
- Inherits:
-
StateChange
- Object
- ActiveRecord::Base
- ApplicationRecord
- StateChange
- StateTransition
- Defined in:
- app/models/state_transition.rb
Overview
Transition of a state machine (a request, a reimbursement...) from one state to another, using the state machine methods. Saving the StateTransition to the database will correctly update the associated state machine automatically.
Instance Attribute Summary collapse
- #state_event ⇒ Object readonly
Attributes inherited from StateChange
#created_at, #from, #machine_type, #notes, #to, #type, #updated_at
Instance Method Summary collapse
Methods inherited from StateChange
#machine, newest_first, oldest_first, #user
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes
Instance Attribute Details
#state_event ⇒ Object (readonly)
9 |
# File 'app/models/state_transition.rb', line 9 validates :state_event, presence: true |
Instance Method Details
#human_action_name ⇒ Object
12 13 14 |
# File 'app/models/state_transition.rb', line 12 def human_action_name I18n.t("activerecord.state_machines.events.#{state_event}") end |