Open johnlauck opened 14 years ago
Same issue. Scoping the query is a solution but i think it's conceptually wrong to return records with nil values.
I am not closing this yet because I want to see if this is still the functionality and see if there is something we can do about it.
I noticed an issue with nil lat/long values:
For ex:
a = Blah.new(:latitude => nil, :longitude => nil)
b = Blah.new(:latitude => x, :longitude => y)
Blah.find_closest(:origin => [x, y])
This will return
a
notb
. Is this the proper intention? Is there a method in place to ignore nils? My solution was to use a named scope to prefilter for nils for the time being.