title: ActiveRecord: Nullify foreign key after deleting a child in self-joins
body: <p>I have a self-join for my model in ActiveRecord, as follows: </p>
  
  <pre><code>class Employee &lt; ActiveRecord::Base
    has_many :subordinates, class_name: "Employee",
                            foreign_key: "manager_id"
  
    belongs_to :manager, class_name: "Employee"
  end 
  </code></pre>
  
  <p>If I delete a Manager row, I expect 'manager_id' foreign key values for all employees that were under that Manager to be set to NULL. Is this something that is handles implicitly by ActiveRecord, or is it something that needs to be defined somewhere.</p>