pluginaweek / state_machine

Adds support for creating state machines for attributes on any Ruby class
http://www.pluginaweek.org
MIT License
3.74k stars 505 forks source link

after_transition's and before_transition's `do` only executes a single method or first array entry #353

Closed lane-flexe closed 7 years ago

lane-flexe commented 7 years ago

If you want to call multiple methods before or after a transaction and specify an array as a key for the do: entry, for example...

after_transition on: :event, do: [:foo, :bar]
before_transition on: :event, do: [:foo, :bar]

...foo will be executed, but bar will not. This does not seem to be th case with an array passed to the on: entry, for example...

after_transition on: [:event1, :event2], do: :foo
before_transition on: [:event1, :event2], do: :foo

...foo will be called in both cases.

lane-flexe commented 7 years ago

Wrong repo, sorry!