2 or more parents, child


Here’s what I hope to accomplish:

A task may have 0,1, or more parent tasks - for example, a task may be top-level, or a simple sub-task (1 parent), or a multi-purpose task (e.g. setting up automatic backup of the svn repository benefits both projectA and projectB [note that I’m treating projects as tasks, just bigger ones with more children]).

It may be relatively rare for a task to have more than one parent, so I’m not sure I want to complicate the entire system because of that. For example I might use a simple parent-child approach for tasks and then have a “tasks_tasks” table to record supplemental parent-child relationships. Alternatively, I could just use “tasks_tasks” to include all such relationships (and perhaps others, e.g. dependencies).

Any thoughts, guidance?



Check out acts_as_graph, it’ll handle multiple parents.