Displaying 1 result from an estimated 1 matches for "relation_froms".
2006 Apr 17
0
Pros/cons of doubling up in Self-Referential has_many via :through
...people who have who
have a relationship with A and all those who A has a relationship. Given
that I also want to get the relationship id, the notes and the
relationshiptype, I''ve got something like this (sorry for all the
relatee and relation_tos, etc):
def allrelations
ar1 = self.relation_froms.find(:all, :include => :relator).collect
{|c| {"id" =>c.id, "notes" =>c.notes, "reltype" => c.reltype, "person"
=>c.relator} }
ar2 = self.relation_tos.find(:all, :include => :relatee).collect
{|d| {"id" =>d.id, "note...