Hello all, This is an interesting problem I have been working on. What I have is a little multiuser project request tracking application. What happens is that I log in and create projects and assign people to the projects. Each project has steps associated with it, and the steps need to be done in a certain order. Now, I have to request that the assigned person perform each of the steps, and need to make sure that I cannot request that the next step be done unless the previous one has been completed. What I have thought is to have a projects table and another table named project_steps with fields: id, name, ordernum, project_id. The ordernum tells the order in which the steps must be performed. Then, create another table, nextsteprequest, with fields: id, project_id, project_step_id. I was thinking that when I request the next step be done I would have the app check to see if the numbers matched up, thus either allowing, or disallowing me from making the request. The question is this: is this the best way to do it (theorizing that I wouldn''t have a form showing me what had been completed and what hadn''t) or is there a better way. Thank you all for your ideas and input. Sincerely, Robert Dempsey -- Posted via http://www.ruby-forum.com/.
On 4/15/06, Robert Dempsey <rdempsey@techcfl.com> wrote:> Hello all, > > This is an interesting problem I have been working on. What I have is a > little multiuser project request tracking application. What happens is > that I log in and create projects and assign people to the projects. > Each project has steps associated with it, and the steps need to be done > in a certain order. Now, I have to request that the assigned person > perform each of the steps, and need to make sure that I cannot request > that the next step be done unless the previous one has been completed. > > What I have thought is to have a projects table and another table named > project_steps with fields: id, name, ordernum, project_id. The ordernum > tells the order in which the steps must be performed. Then, create > another table, nextsteprequest, with fields: id, project_id, > project_step_id. I was thinking that when I request the next step be > done I would have the app check to see if the numbers matched up, thus > either allowing, or disallowing me from making the request. > > The question is this: is this the best way to do it (theorizing that I > wouldn''t have a form showing me what had been completed and what hadn''t) > or is there a better way. > > Thank you all for your ideas and input. >Check out acts_as_state_machine. Very fun stuff: http://lunchroom.lunchboxsoftware.com/articles/2006/01/21/acts-as-state-machine
Will do. Thanks for the pointer. - Rob D. Wilson Bilkovich wrote:> Check out acts_as_state_machine. Very fun stuff: > http://lunchroom.lunchboxsoftware.com/articles/2006/01/21/acts-as-state-machine > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >