Hello, I'm relatively new to Rails and had a question about how to
best set up relationships between a few of my objects. Right now, I've
got the following model objects:
A Transmission contains many Lists and a List contains many
Techniques. So far so good. However, a List can also contain many
other Lists (a kind of "sub list") and these "sub lists" will also
contain many Techniques.
So, the relation between Transmissions and Lists is pretty
straightforward, as is the relationship between Techniques and Lists.
The problem I'm having is in regards to this recursive relationship
between Lists and their child Lists. A list could contain:
1) Only techniques (i.e. no other Lists)
2) A combination of Techniques and Lists (each List with its own
3) Only child Lists (i.e. no Techniques as direct children)
I'm not sure if it makes things easier or not, but a given List will
never be a parent to other Lists AND a child of another List...only
one or the other. In other words, if ListA has a child, ListB, then
ListB will never really exist outside of the context of ListA.
After writing this out, it's even more confusing than before. I hope
someone can point me in the right direction with this. Thanks in