title: How do you validate uniqueness of a pair of ids in Ruby on Rails?
body: <p>Suppose the following DB migration in Ruby:</p>
  
  <pre>
      create_table :question_votes do |t|
        t.integer :user_id
        t.integer :question_id
        t.integer :vote
  
        t.timestamps
      end
  </pre>
  
  <p>Suppose further that I wish the rows in the DB contain unique (user_id, question_id) pairs.  What is the right dust to put in the model to accomplish that?</p>
  
  <p><pre>validates_uniqueness_of :user_id, :question_id</pre> seems to simply make rows unique by user id, and unique by question id, instead of unique by the pair.</p>