Skip to content
Snippets Groups Projects
Commit e112624e authored by Giovanni Cappellotto's avatar Giovanni Cappellotto
Browse files

Fix "Mysql2::Error: Unknown column 'NaN' in 'where clause'" error

parent 56a3bf17
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ module Geocoder::Store ...@@ -33,7 +33,7 @@ module Geocoder::Store
# #
scope :near, lambda{ |location, *args| scope :near, lambda{ |location, *args|
latitude, longitude = Geocoder::Calculations.extract_coordinates(location) 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) near_scope_options(latitude, longitude, *args)
else else
where(false_condition) # no results if no lat/lon given 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