I have a question about how to implement a design in Rails. I will try
to make this as easy to follow as possible. First, let’s say that I
have an ‘Orders’ table that has different statuses. The 3 statuses that
I want to track are ‘Submitted’, ‘Approved’, and ‘Purchased’.
I also have 3 users of this application.
- User A can submit an order
- User B should only see orders with ‘Submitted’ status and can
- User C should only see ‘Submitted and Approved’ orders and can
‘Purchase’ the order
I realize this is more of a workflow question, but I’m trying to figure
out the best way to structure this.
Here is one thought…
Then, I can do a join in the model to only return the correct rows. Is
this the correct way to do this? Also, what type of logic should I be
doing in the controller (i.e. Making sure that the Order is approved and
submitted before Purchasing can order it)?
Please see the following link for the BlueCross BlueShield of Tennessee