Suppose I have a `Parent` model that has many `Child`, and that `Child` also belongs to `OtherParent`.

How can i find all `Parent` where ALL of its `Child` belongs to any `OtherParent`?

In pure SQL I could do 

```
Parent.find_by_sql(<<SQL)
  SELECT *
  FROM parents p
  WHERE NOT EXISTS (
    SELECT *
    FROM children
    WHERE parent_id = p.id
      AND other_parent_id IS NULL
  )
SQL

```

(from [here](https://stackoverflow.com/questions/6430761/rails-how-to-query-for-all-the-objects-whose-every-association-have-an-attribut)), but I'd prefer to do it by taking advantage of ActiveRecord if possible.

Thanks!

---

I'm using Rails 4.2.1 and PostgreSQL 9.3