Hi,
I'm creating a little social network in Rails, where people can add eachother as a friend. I have created a model called 'user', which contains, e-mail, strong md5 hash with salt of password etc...
My question is: how do I create something like an option to add another user as a friend. Is it possible to have something like has_many_and_belongs_to :user in the user model? So a user has many users and belongs to many users. Or should I use an other way, like adding a friendship model which has user1s_id:integer and user2s_id:integer? Which way does twitter do it?
Thanks.