geokit / geokit-rails

Official Geokit plugin for Rails/ActiveRecord. Provides location-based goodness for your Rails app. Requires the Geokit gem.
MIT License
1.57k stars 245 forks source link

nil latitude and logitude #13

Open johnlauck opened 14 years ago

johnlauck commented 14 years ago

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 not b. 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.

marqu3z commented 10 years ago

Same issue. Scoping the query is a solution but i think it's conceptually wrong to return records with nil values.

ryankopf commented 3 years ago

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.