AASM Coder State machine patterns for managing workflow states in Rails. Setup Basic State Machine Usage Guards Callbacks Callback order: 1. (event) 2. (old state) 3. (new state) 4. State change persisted 5. (old state) 6. (new state) 7. (event) Multiple Transitions First matching guard wins. Error Handling Testing State Machines Advanced Patterns For multiple state machines, persistence options, and history tracking see: - Related Skills - - For recording domain events when state transitions should trigger notifications, webhooks, or audit trails. ---