-
Notifications
You must be signed in to change notification settings - Fork 513
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
Generic guards #267
Comments
If you don't need the fluffy can_fulfill? etc. instance methods you could just write a |
@the8472 thanks, but this doesn't seem to work, I tried returning false in a before_transition filter but the transition still happens. It seems like before_transition has no relevance to wherever the transition should proceed. |
I thought returning false does work. But the documentation says |
Ah, it depends on the integration, default is the throw, but you can configure another one, such as the AR-integration does: http://rdoc.info/github/pluginaweek/state_machine/master/StateMachine/Callback:terminator |
@the8472, thanks |
At the moment I am doing something like this:
:if => :can_transition?
is repeated in every transition declaration which make the code harder to maintain.Maybe there is a way already that I don't know of but it would be really nice if there was a way of defining generic guards, instead of this repetition.
Similar to this request
https://groups.google.com/forum/#!searchin/pluginaweek-talk/condition/pluginaweek-talk/KwE8g1OKXZg/70driFcCLG8J
The text was updated successfully, but these errors were encountered: