-
Notifications
You must be signed in to change notification settings - Fork 162
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
after_transition doesn't have previous state scoped #259
Comments
It seems like this won't give the correct state in the case that we are in the second state (i.e. There has only been one transition). Going to need to use
I can't find any reference to previous state in this repo? I am a bit confused how this is not something required regularly by other users of this gem? |
In
This means that it can potentially pull the most recent transition (if persisted).
Then this means that we could potentially pull the transition twice.
|
@stevebissett Looks interesting and more appropriate, IMO. One transition should be considered as the movement from state to something else. Would be handy. Funny mentioning the |
Let's say we need to send an email after every state transition and the requirement is to include in this email subject: "Changed From: #{previous_state} TO: #{current_state}"
The way I currently do it:
Why not having the "from" state scoped here? It would not be correct doing this on
before_transition
callback as something could go wrong, right? Even though, we could rely on validations, usingbefore_transition
would be semantically incorrect.The text was updated successfully, but these errors were encountered: