Topic: New to rails, not sure how to model this
Well, as in the title, I'm pretty new to rails, though I've been messing around with it on and off for a few months. nothing big, just some test projects with everything pretty simple.
Well, right now I'm trying to put something together and I'm having trouble conceptualizing just how to model things. I'm putting together what basically amounts to a family tree - I have people, and I have relationships between people (ie, a father may have a daughter or two and a wife). I've tried person has_many :relationships and relationship belongs_to :person, but that seemed to just confuse me and my app. Likewise, I had trouble putting together a coherent db schema, as a relationships table would need two different person_id's (continuing the example, a relationship would have one id for the father, and one for his daughter).
With this app, I would need to be able to, when pulling a page up about a certain person, have links with names to those people that the person has relationships with.
Any suggestions? Thanks in advance.
EDIT: I'd just like to expand a little on this as well. I know it complicates things a bit, but I'd like to be able to have both a Father and a Mother branch down to the same Children (as tends to happen in families . Advice is appreciated.
Last edited by el.phantasmo (2006-11-16 01:59:47)