Created
June 14, 2016 10:06
-
-
Save leemour/eb0053fc51a8a6cd3187050aaf613513 to your computer and use it in GitHub Desktop.
Rails: HABTM - find all records with no association
This file contains hidden or 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
Buyer.joins("left join buyers_metro_stations bms on buyers.id = bms.buyer_id").where("bms.id is null") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment