-
Notifications
You must be signed in to change notification settings - Fork 510
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
Assigning 'state_event' through nested attributes fails. #327
Comments
smudge
changed the title
Assigning 'state_event' through nested attributes fails with rollback.
Assigning 'state_event' through nested attributes fails.
Oct 27, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems that this project is mostly dead/stalled at this point, but I'm filing this issue for posterity's sake.
The bug is around the ability to fire off an event by assigninment, as follows:
Here's the repro setup (using a totally new rails 3.2.19 app):
Then, from console (or in your controller) run the following commands:
That last command should cause the car to go from driving to parked, but instead the transaction is rolled back with the error
:"car.state_event"=>["cannot transition when parked"]
. If you check the car state without reloading the model, it saysparked
, but after reload it goes back todriving
.So it seems that something is setting the car state to
parked
as expected, but then a rollback occurs because thedrive
event cannot transition from aparked
state. (Like it's trying to transition twice and then rolls it all back when the 2nd one fails.)The text was updated successfully, but these errors were encountered: