Possible Duplicate:
Rails 3 finding parents which have no child
I need to find all objects that does not have a nested object attached.
I'm aware of User.all.includes(:address)
includes all with an "address" nested object but I'm not sure how to do the opposite.
The schema looks something like this. There's no User.address_id
attribute.
User
has_one :address
Address
belongs_to :user
user_id: integer
address: string