Hi! The next question:
I have 2 tables: 1) persons - where some people info places (e.g. name, second name, birth date et.c.) 2) persons_relationships - here app would write relationships between persons. Here is structure: id>from>to>type, where from is the one person id, to - second person id, type is kind of relations between them (friend-friend, parent-child, husband-wife et.c.)
So, when I prefer to find all person relationships (@person.relationships) - in model I can create query only with :from or only :to fields. Eg.: if I create association @person.id with :from field, but in record in relationships table client id would place in :to field, then this record will be removed from @person.relationships. How I can prevent this error?