Want to find records with no associated records in Rails
Update 4 – Rails 6.1 Thanks to Tim Park for pointing out that in the upcoming 6.1 you can do this: Person.where.missing(:contacts) Thanks to the post he linked to too. Update 3 – Rails 5 Thanks to @Anson for the excellent Rails 5 solution (give him some +1s for his answer below), you can use … Read more