-
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
Saving in after_transition on AR: Bug or bad docs? #305
Comments
The gem is for general use so it won't save the object |
That's ok for me, but the docs should be updated then. They're very misleading now. |
The docs are not important for now. The whole gem is not maintained and is incompatible with new version of rails or mongodb for example. |
Is this what you mean #291? |
@seuros Stating that the "docs are not important for now" is a rather bold statement, considering the fact that this project has been starred more than 3000 times (i.e. lots of people are using this gem) and that the readme (wrongly) states that this gem supports the latest version of rails. Indeed, quoting the readme:
I'm currently on a project using this Suggestion: I think the project's readme should make it clear. |
The docs for ActiveRecord show this:
after_transition any => :parked do |vehicle, transition|
vehicle.seatbelt = 'off'
end
I would then expect that the new value for vehicle.seatbelt would be saved to the database. But this doesn't happen (state_machine v. 1.2, rails v. 3.2.15): the attribute is changed, but if I reload from the DB, it goes back to the old value.
On the contrary, the new value gets saved in a before_transition.
Is this a bug, or just something that should be clarified in the documentation?
The text was updated successfully, but these errors were encountered: