elado/neoid — Issue #2: Example of a self referential relationship 
Author: matthewford
Created: 2012-02-02 01:32:13+00:00
State: open

Hi,

I was wondering what would be the best way to define a self referential relationship e.g:

class User
has_many :follows
has_many :followed_users, through: :follows
end

class Follow < ActiveRecord::Base
belongs_to :user
belongs_to :followed_user, :class_name => 'User'
end