title: How do I ensure that duplicate rows are not added to my database table via activerecords?
body: <p>So I have a table called votes.</p>
  
  <p>There are three columns. VoterID, VoteforID and Vote.</p>
  
  <p>The uniqueness of each individual column is not important however, the same row cant repeat twice</p>
  
  <p>For instance. This is correct </p>
  
  <p>Voter_id  |  Votefor_id  |  Vote</p>
  
  <p>1          |         2  |  1</p>
  
  <p>1          |         3  |  1</p>
  
  <p>1          |         4  |  1</p>
  
  <p>2          |        1   |  2</p>
  
  <p>This is wrong.</p>
  
  <p>Voter_id  |  Votefor_id  |  Vote</p>
  
  <p>1          |         2  |  1</p>
  
  <p>1          |         2  |  1</p>
  
  <p>1          |         4  |  1</p>
  
  <p>2          |        1   |  2</p>
  
  <p>Currently, I am doing a select statement before adding records just to make sure that an identical row does not exist. Surely, there is a better solution.</p>
  
  <p>Thank you.</p>