Skip to content

Instantly share code, notes, and snippets.

@melvynhills
Created October 30, 2014 17:07
Show Gist options
  • Save melvynhills/b692531c926d735e8672 to your computer and use it in GitHub Desktop.
Save melvynhills/b692531c926d735e8672 to your computer and use it in GitHub Desktop.
Find duplicate records in Rails
User.select(:name,:email).group(:name,:email).having("count(*) > 1").count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment