Has and belongs to many with a single table

It's pretty simple, all you need to do is to create 2 foreign keys and specify to where they point to.

class Event << ActiveRecord::Base

  belongs_to :first_event, :class_name => "Event", :foreign_key => "first_event_id"   belongs_to :second_event, :class_name => "Event", :foreign_key => "second_event_id"

end