Skip to content
Snippets Groups Projects
Commit 4e924703 authored by Alex Reisner's avatar Alex Reisner
Browse files

Merge pull request #234 from potomak/master

Fix "Mysql2::Error: Unknown column 'NaN' in 'where clause'" error
parents 56a3bf17 e112624e
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ module Geocoder::Store
#
scope :near, lambda{ |location, *args|
latitude, longitude = Geocoder::Calculations.extract_coordinates(location)
if latitude and longitude
if latitude and longitude and ![latitude, longitude].include?(Geocoder::Calculations::NAN)
near_scope_options(latitude, longitude, *args)
else
where(false_condition) # no results if no lat/lon given
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment