Hello, 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? Thanks! Marc --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Check out acts_as_graph, it''ll handle multiple parents. http://blog.tammersaleh.com/pages/acts_as_graph On 8/31/07, Marc Byrd <dr.marc.byrd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello, > > 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? > > Thanks! > > > Marc > > > > >-- Joshua Bates http://www.linkedin.com/in/joshuabates --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Joshua Bates wrote:> Check out acts_as_graph, it''ll handle multiple parents. > > http://blog.tammersaleh.com/pages/acts_as_graph >That''s a really good solution for what the poster is asking. I wrote an acts_as_graph as well, and it''s under http://gratr.rubyforge.org. The difference here is that Tammersaleh''s fits 95% of most common usage and looks like it does it cleanly and more "Railish". The one I wrote ties into advanced graph algorithms so crazy things like condensation graphs and sub graphs determinations are possible. Also there is a rich set of graph search algorithms in gratr. Personally, after looking thorough tammersaleh''s code I''d use that if it meets your needs. If you need some advanced graph manipulation, look at gratr. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---