In a one to many relationship with no counter cache how can I find parents with no child?
user.rb
has_many :pages
page.rb
One way would be
User.where("(SELECT COUNT(*) FROM pages WHERE pages.user_id = users.id) = 0")
But I'm not sure how (in)efficient that would be.