Topic: I'm getting into a steamy three-way relationship tonight
Finally I have some time to start flexing my Rails muscle. Whew.
Anyway, I have a bit of an issue. As a really simplified example, imagine I have three models/tables:
So basically when I write an article, it's associated with a subcategory, and from that subcategory I derive the parent category. There's no real link between article and top category at this point, and that's posing a problem. I could put additional category information in the articles table, but that seems like it would add a lot of unwanted repetition. The specific problem right now I have is that I'd love to Article.find_by_topic_id, but at this point there's no relationship set up for that. I'm still wrapping my head around how Rails does relationships and what might be the proper way to do all of this. Any ideas or directions I could head in? Thanks a bunch.