I have used workflow gem to do similar stuff.
It has several states and transition event to switch from one to another state. You can record the data in the transition event.
質問
In our rails
app, some model
may require approval process
. For example, for purchasing order (PO)
, usually it starts with a submission of the PO
, then manager approves and CEO approves before the PO
can be sent out to suppliers. The approval procedure is likely predefined. Along with the approval process
, we would also like to record data for every transition:
1. who did it (use id),
2. when she/he did it (time stamp)
3. comment by approval person (usually text).
4. approval process can be attached to the model late on demand.
There are quite a few state machine
ruby gem
out there (such as state machine
). Our question is that: is the state machine enough to fulfill the requirement laid out above?
解決
I have used workflow gem to do similar stuff.
It has several states and transition event to switch from one to another state. You can record the data in the transition event.