I’ve been googling this for the last day, and right now all I’ve got is
a headache. There are several articles on this - but they are not making
sense. One is using a field :association_foreign_key that I can’t find
in my documentation. I admit it, I’m lost.
Assume I have a Categories table. To make it simple, give it one field,
A category can be at the top level (no parents)
A category can be subordinate to another category (it’s child - and
obviously, the first category is the parent. This is a self-referential
OK, I know that I need a join table - for grins, lets call that
Relationship with two fields: category_id and parent_id. This isn’t
carved in stone. If I need another layout - and it works - I’m happy as
I can be.
What models do I need, and how do I define these relationships? Can
anyone help here.