An example of finding records with no associated record.
● master ~/Code/OSS/no-associated » bundle console
irb(main):002:0> require_relative 'dog'
=> true
irb(main):003:0> require_relative 'owner'
=> true
irb(main):004:0> Owner.create!
=> #<Owner id: 1, dog_id: nil>
irb(main):005:0> _.create_dog!
=> #<Dog id: 1>
irb(main):006:0> Dog.create!
=> #<Dog id: 2>
irb(main):007:0> Dog.all
=> #<ActiveRecord::Relation [#<Dog id: 1>, #<Dog id: 2>]>
irb(main):008:0> Dog.includes(:owner).where(owners: { id: nil })
=> #<ActiveRecord::Relation [#<Dog id: 2>]>
irb(main):009:0> Dog.includes(:owner).where(owners: { id: nil }).to_sql
=> "SELECT \"dogs\".\"id\" AS t0_r0, \"owners\".\"id\" AS t1_r0, \"owners\".\"dog_id\" AS t1_r1 FROM \"dogs\" LEFT OUTER JOIN \"owners\" ON \"owners\".\"dog_id\" = \"dogs\".\"id\" WHERE \"owners\".\"id\" IS NULL"