What is the best way to find records with duplicate values in a column using ruby and the new Activerecord?
With custom SQL, this finds types with same values for name:
types
name
sql = 'SELECT id, COUNT(id) as quantity FROM types GROUP BY name HAVING quantity > 1' repeated = ActiveRecord::Base.connection.execute(sql)