title: rails model has_many of itself
body: <p>I have a event model. Events can have parent events, set from a column in the model (parent_event_id). I need to be able to do <code>has_many :event</code> on the model, so I can just do, for example, <code>event.child_event</code> or <code>event.parent_event</code>. But my googling hasn't worked out that well.</p>
  
  <p>My Model:</p>
  
  <pre><code>class Event &lt; ActiveRecord::Base
      attr_accessible :days_before, :event_name, :event_date, :list_id, :recipient_email, :recipient_name, :parent_event_id, :is_deleted, :user_id
  
      belongs_to :user
      has_many :event_email
      has_many :event
  end
  </code></pre>
  
  <p>My Schema:</p>
  
  <pre><code>create_table "events", :force =&gt; true do |t|
      t.datetime "event_date"
      t.integer  "days_before"
      t.string   "recipient_email"
      t.integer  "list_id"
      t.string   "recipient_name"
      t.datetime "created_at",                         :null =&gt; false
      t.datetime "updated_at",                         :null =&gt; false
      t.integer  "user_id"
      t.string   "event_name"
      t.integer  "parent_event_id"
      t.boolean  "is_deleted",      :default =&gt; false
  end
  </code></pre>