Displaying 1 result from an estimated 1 matches for "all_friends".
Did you mean:
all_fields
2006 Mar 25
0
Self-Referential Many-To-Many relationships where the relationship itself has data.
...cipe (12) and the many to many
relationships where the relationship itself has data recipe (16). So
users have unique names, and friendships have user_id''s, friend_id''s,
and ratings. And here''s the model code:
class User < ActiveRecord::Base
has_and_belongs_to_many :all_friends,
:class_name => "User",
:join_table => "friendships",
:foreign_key => "user_id",
:association_foreign_key => "friend_id"
has_and_belongs_to_many :close_friends,
:class_name => "User",
:join_table => "...