geekq / workflow

Ruby finite-state-machine-inspired API for modeling workflow
MIT License
1.75k stars 207 forks source link

Wrap state transitions in a locking transaction #188

Closed tylergannon closed 8 years ago

tylergannon commented 8 years ago

Motivation: 1) For databases that support row-level locking, prevent simultaneous changes to the same record 2) Allow for after_transition to trigger a rollback of the state change or any changes that were persisted in before_transition or on_transition.

tylergannon commented 8 years ago

All the tests are passing except for one that seems written to break... within the Rails-5.0 series, a test that depends on the deprecated #attr_accessible class method on ActiveRecord::Base.

tylergannon commented 8 years ago

Closing this one as I think it should be superseded by #189.