-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple from/to in transition definition block #210
Comments
I'm looking at the code and it seems that you do support an array for the to: state but not from: and it looks like an easy change in the callback.rb file to allow this. |
I think this has been discussed before, and we decided that having array-to-array callbacks could be confusing. @hmarr - do you have the context? |
Yes, there was a long discussion about this in #95. This comment describes the original reasoning. We actually initially allowed arrays for both @marclennox it's probably worth starting by having a skim through #95. After that, if you've got a good example of where supporting a |
Thanks @hmarr. I recently moved away from the I use the events module and have a few cases where different events transition to the same 'to' state, but from different 'from' states. Depending on the event that triggered the transition, I may have different logic in Perhaps this is not a proper use of a state machine, but this is how I did it with Alternatively, is there a way I can get access to the triggering event or the 'from' state from within the after_transition block? I was able to make the code change to |
Is there a way to specify an array of from: or to: states in the transition definition block? If not are you open to a PR?
The text was updated successfully, but these errors were encountered: