something like this also works
self.where("active = ? AND latitude IS NOT ?", true, nil)
OR
Rails 4 way
self.where(active: true).where().not(latitude: nil)
Вопрос
I'm trying to do something like...
self.where(active: true, latitude: !nil)
this doesn't work. I basically need something that queries for objects who HAVE a latitude property which has a value. Thanks!
Решение
something like this also works
self.where("active = ? AND latitude IS NOT ?", true, nil)
OR
Rails 4 way
self.where(active: true).where().not(latitude: nil)