-
Notifications
You must be signed in to change notification settings - Fork 95
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 state_machines... #50
Comments
Well, in theory it should be possible, however I found out that this doesn't work right now unfortunately. state_machine :foo do breaks the functionality. But then again, naming a state machine only makes sense if we have more than one (otherwise it's just default), so this is all more or less the same issue. I am thinking of something like this (This won't work right now): state_machine do # name will be `default`
...
end
state_machine :foo
...
end where you can switch like that my_model.switch_state_machine :foo If you need that badly, you'll have to come up with a pull request I'm afraid..:-) |
@dlepage Oh, and what's your use case for having multiple state machines for one model? |
Sure ! :) First of all, most of the time it's better to split a model into simple models... but sometime, it's overkill. We can imagine a model that you have two(or more) points of view... eg. :
On 2012-05-18, at 07:16, Timo Rößner wrote:
|
I see your reasoning. However, I am not convinced - "Human being" would be a "human" object composed of "body" and "spirit" for me...:-) |
Please add "this gem is limited to one state machine for each model. Envoyé de mon iPhone Le 2012-05-21 à 18:41, "Timo Rößner"
|
Is it possible to have more than one state_machine in a model.
How to setup (state column name, fire évents from this second state_machine ?)
Many thanks !
The text was updated successfully, but these errors were encountered: