So I have a Post and a User. Post has_many users and a user belongs_to a post. I need a find that will find all the Posts that dont have any users like the following:
something like that:
p = Post.arel_table u = User.arel_table posts = Post.find_by_sql(p.join(u).on(p[:user_id].eq(u[:p_id])).where(u[:id].eq(nil)).to_sql)