Created
September 2, 2016 00:46
-
-
Save anggiaj/cd649eb3dbeb83ee26edf436cfb8105b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find something that has more than one of something | |
Account.joins(:users).select('accounts.id').group('accounts.id').having('count(users.id) > 1') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment