Reputation: 48535
I'm creating a scope in my rails app, I want my scope to return documents which have anything set for the field in question.
scope :address_available, where(:address => "")
So because some documents might not have that field defined, and others will have a string as the value. But how can I return the documents which are not nil
?
Upvotes: 5
Views: 1237