Many-To-Many w/acts_as_tree?


#1

Guys,

I’m having a problem getting acts_as_tree working. It seems from the
Agile book (p. 255) that acts_as_tree only supports one-to-one record
relations, whereas I need many-to-many support. In other words, looking
at the picture at the top of page 256 where where only 1 id is linked to
1 parent_id, I need multiple id’s linked to multiple parent_id’s - for
example, id = 6 linked to not only parent_id 3, but also parent_id 7 and
5 (not really parents, just linked). Obviously w/the id column being a
primary key, duplicate values of id = 6 isn’t going to work.

Any suggestions on getting this to work?


#2

On 08 Feb 2006, at 20:27, Peter J. wrote:

7 and
5 (not really parents, just linked). Obviously w/the id column
being a
primary key, duplicate values of id = 6 isn’t going to work.

Any suggestions on getting this to work?

Recipe 7 in the Rails Recipes Beta book will help you out on this
one: Self-referential Many-to-Many Relationships. Even in this early
stage, the book is well worth its price.

Best regards

Peter De Berdt