Relationship like Twitter followers/followed in ActiveRecord

Viewed 6919

I'm trying to represent a relationship between users in my application where a user can have many followers and can follow other users. I would like to have something like user.followers() and user.followed_by() Could you please tell me in details how to represent this using ActiveRecord?

Thanks.

2 Answers
Related