Acts_as_family_tree

For a project that I am working on I need to have a family tree. This
means that instead of having one parent each item has at most two. As
far as I know acts_as_tree only allows one parent_id. Any suggestions
on how to make a “acts_as_family_tree” ?

Thanks,
Mark

Hi Alex,
Yes, I have HATBM right now but I was hoping to leverage off of the
acts_as_tree helper methods like node.ancestors, node.siblings,
node.children etc. I don’t think it would be that bad to extend
acts_as_tree to work as a family tree as well. If I find a nicely
encapsulated solution I’ll release it as a plugin too.

Mark

On 2/2/06, Alex Y. [email protected] wrote:


Alex


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

M Daggett wrote:

Hi Alex,
Yes, I have HATBM right now but I was hoping to leverage off of the
acts_as_tree helper methods like node.ancestors, node.siblings,
node.children etc. I don’t think it would be that bad to extend
acts_as_tree to work as a family tree as well. If I find a nicely
encapsulated solution I’ll release it as a plugin too.

Please do! I’d be intrigued.

M Daggett wrote:

For a project that I am working on I need to have a family tree. This
means that instead of having one parent each item has at most two. As
far as I know acts_as_tree only allows one parent_id. Any suggestions
on how to make a “acts_as_family_tree” ?
Better to HABTM onto the item table, surely? That way there’s no
problem expanding out to adoptive and natural parents, step-parents, and
so on?