I'm looking for a trick how to get something like that:
obj1 = SmthClass.new
obj2 = SmthClass.new
obj1.connections << obj2
>> obj1.connections
=> obj2
>> obj2.connections
=> obj1
??
PS: The first solve is to make the third join model, and put them all
necessary has_many + has_many relationship, then give the join model
optional method using transaction etc, so it's inevitable to have two
identical strings in the join models' database table (to obj1 and
obj2)...? Or i can write some handler to seek obj1 and obj2 using
'their own' foreign keys one by one through each other (two has_many
methods with two different foreign keys)?
This earlier thread might be helpful.
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/20ad808815a17080/b27fdea7e816df82
What are you think? I guess, there is no transaction improvements to
be a super nice :)
On 02.09.2008, at 0:55, Craig Demyanovich wrote:
>> friend2.reverse_friends
=> friend1
that is not what i want