geekq / workflow

Ruby finite-state-machine-inspired API for modeling workflow
MIT License
1.75k stars 207 forks source link

The Workflow::Event object isn't readily available #151

Closed ezuhaib closed 2 years ago

ezuhaib commented 9 years ago

I expect the following to return an Workflow::Event object

@article.current_state.events[:publish]
@article.current_state.events.first

Whereas both of these return arrays for me, making me have to use:

@article.current_state.events[:publish][0]
@article.current_state.events.first[1][0]
tijmenb commented 9 years ago

current_state returns an array of events because there can be multiple events named publish. See https://github.com/geekq/workflow/pull/109 for the change that introduced this.

jkingsbery commented 9 years ago

I like this idea, would be useful.