title: Ensure belongs_to combination is unique
body: <p>I don't know what is the proper manner to ensure that there is only one record with the same couple of foreign keys. Let's assume a class named LineItem, which belongs to an <code>cart</code> and to <code>item</code>. Something like:</p>
  
  <pre><code>class LineItem &lt; ActiveRecord::Base
    belongs_to :cart
    belongs_to :item 
  </code></pre>
  
  <p>The point is: I want to make unique the combination of this two "attributes". At this time, my approach was using a <code>after_save</code> callback but I realized thats pretty poor. How do you resolve this? I was thinking in a PORO class (something like LineItemSaver) but I'm not completely convinced.</p>
  
  <p>Thanks!</p>