Forum: Ruby on Rails Making requests in order

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Robert D. (Guest)
on 2006-04-16 04:34
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 D.
Wilson B. (Guest)
on 2006-04-16 05:17
(Received via mailing list)
On 4/15/06, Robert D. <removed_email_address@domain.invalid> wrote:
> What I have thought is to have a projects table and another table named
>
> Thank you all for your ideas and input.
>

Check out acts_as_state_machine. Very fun stuff:
http://lunchroom.lunchboxsoftware.com/articles/200...
Robert D. (Guest)
on 2006-04-16 05:30
(Received via mailing list)
Will do. Thanks for the pointer.

- Rob D.
This topic is locked and can not be replied to.