Class StateMachine::TransitionCollection
In: lib/state_machine/transition_collection.rb
Parent: Array

Represents a collection of transitions in a state machine

Methods

new   perform  

Included Modules

Assertions

Attributes

skip_actions  [R]  Whether to skip running the action for each transition‘s machine
skip_after  [R]  Whether to skip running the after callbacks
use_transaction  [R]  Whether transitions should wrapped around a transaction block

Public Class methods

Creates a new collection of transitions that can be run in parallel. Each transition must be for a different attribute.

Configuration options:

  • :actions - Whether to run the action configured for each transition
  • :after - Whether to run after callbacks
  • :transaction - Whether to wrap transitions within a transaction

Public Instance methods

Runs each of the collection‘s transitions in parallel.

All transitions will run through the following steps:

  1. Before callbacks
  2. Persist state
  3. Invoke action
  4. After callbacks (if configured)
  5. Rollback (if action is unsuccessful)

If a block is passed to this method, that block will be called instead of invoking each transition‘s action.

[Validate]