title: Remove duplicate records based on multiple columns?
body: <p>I'm using Heroku to host my Ruby on Rails application and for one reason or another, I may have some duplicate rows.</p>
  
  <p>Is there a way to delete duplicate records based on 2 or more criteria but keep just 1 record of that duplicate collection?</p>
  
  <p>In my use case, I have a Make and Model relationship for cars in my database.</p>
  
  <pre><code>Make      Model
  ---       ---
  Name      Name
            Year
            Trim
            MakeId
  </code></pre>
  
  <p>I'd like to delete all Model records that have the same Name, Year and Trim but keep 1 of those records (meaning, I need the record but only once). I'm using Heroku console so I can run some active record queries easily.</p>
  
  <p>Any suggestions?</p>