Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Howto get all state_machine events from model class?

Is it possible to get all events from a model class? I want to filter a list by events.

There was a similar question on mailinglist about all transitions.

I am using https://github.com/pluginaweek/state_machine

like image 884
tonymarschall Avatar asked Feb 21 '23 06:02

tonymarschall


1 Answers

Right on the github page you link to it shows the API methods for:

vehicle.state_events  # shows all the events possible from the current state

and

vehicle.state_paths.events # shows all the events for an object
like image 170
Pavling Avatar answered Mar 08 '23 17:03

Pavling