title: How do I prevent deletion of parent if it has child records?
body: <p>I have looked through the Ruby on Rails guides and I can't seem to figure out how to prevent someone from deleting a Parent record if it has Children.  For example.  If my database has <strong>CUSTOMERS</strong> and each customer can have multiple <strong>ORDERS</strong>, I want to prevent someone from deleting a customer if it has any orders in the database.  They should only be able to delete a customer if it has no orders.</p>
  
  <p>Is there a way when defining the association between models to enforce this behavior?</p>