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

Add parentheses for explicit operator precedence.

Fixes #1243.
parent d6a7b65c
No related branches found
No related tags found
No related merge requests found
...@@ -47,8 +47,8 @@ module Geocoder ...@@ -47,8 +47,8 @@ module Geocoder
spans = "#{lat_attr} BETWEEN #{sw_lat} AND #{ne_lat} AND " spans = "#{lat_attr} BETWEEN #{sw_lat} AND #{ne_lat} AND "
# handle box that spans 180 longitude # handle box that spans 180 longitude
if sw_lng.to_f > ne_lng.to_f if sw_lng.to_f > ne_lng.to_f
spans + "#{lon_attr} BETWEEN #{sw_lng} AND 180 OR " + spans + "(#{lon_attr} BETWEEN #{sw_lng} AND 180 OR " +
"#{lon_attr} BETWEEN -180 AND #{ne_lng}" "#{lon_attr} BETWEEN -180 AND #{ne_lng})"
else else
spans + "#{lon_attr} BETWEEN #{sw_lng} AND #{ne_lng}" spans + "#{lon_attr} BETWEEN #{sw_lng} AND #{ne_lng}"
end end
......
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