You can create A Join Model that relation between the Link between the two users models
so basically
class User
has_many :links, :through => :relationships
end
class Relationship
belongs_to :user_id_1, :class=> "User"
belongs_to :user_id_2, :class=> "User"
end