state_machines icon indicating copy to clipboard operation
state_machines copied to clipboard

Adds support for creating state machines for attributes on any Ruby class

Results 12 state_machines issues
Sort by recently updated
recently updated
newest added

PR #32 introduced functionality to always return a machine if one is present and no key is supplied to the `state_machine` call. This broke having multiple state machines on the...

The code that was posted before changed the value of the state method in the Vehicle class to the initial one, no matter if it already has one or not.

Hello! I use this gem along with the AR extension on a Rails app on Ruby 2.7. We override some of the transition methods for the state machine with kwargs,...

When defining a state machine, `Machine#define_state_predicate` first [checks to see whether the method it would add is already defined](https://github.com/state-machines/state_machines/blob/v0.5.0/lib/state_machines/machine.rb#L1942-L1951) or not. However, when defining a state, `State#add_predicate` [does no such...

Hi, Writing this issue because I use your gem and I have one small issue : My state are constant, like that : ` STATES = [ STATE_INTERNAL_DELIVERY = 'internal_delivery',...

When writing tests for some after_transition callbacks I haven't seen exceptions being raised within the callback. Example: ``` ruby after_transition, :on => :finish, :do => :finish_it def finish_it foo end...

I can't find the bang version of `fire_state_event` (throw error instead of returning false). What is the best way to add this feature?

It appears that I cannot specify `do:` on a transition definition such as ``` ruby event :expire do transition :active => :expired, do: :process_superceded, if: [:has_next?, :ended?] transition :trial =>...

enhancement

## TLDR; Currently, arguments passed to an event are not passed to the guard, only the model object. I'm wondering if there is a reasoning behind this (i.e. is it...

enhancement

Hello, We have a multi-tenant application and would like to hard-code our state machine definitions, but be able to dynamically pick which state machine gets selected based on our tenant....