Q:

Conditionals in an Active Record query

I have a large database of information. They are mostly patients. Some of them have email addresses and some of them don't.  I can pull an additional email address by simply running 
Patient.last.email

However I only want to see the patients who do not have email addresses.  (I think its about half of the ones that I have)
I've tried both these below, but not having the best of luck. 
Patient.includes(:email).where('email = ?', 'nil')
Patient.includes(:email).where('email = ?' 'nil').references(:email)

Would anyone know what I'm doing wrong?

A:

Simple then.
Patient.where(email: nil)

Should get you your result.

