title: Find all objects with broken association
body: <p>I have two models in my rails app with a has many and belongs to association.
  Category has many items and Item belongs to category.</p>
  
  <p>These models are associated in the normal way through a category_id column in the Item model.</p>
  
  <p>I'm looking for a quick way of finding all elements in the database with broken associations.
  i.e. find all categories that exist with no associated items and items that exist with no associated category.</p>
  
  <p>For example, if I have an item with a category_id of 7, but the category with id 7 has been deleted then this would be considered broken.</p>