문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top