Skip to content
Snippets Groups Projects
Commit 7610cf9f authored by Adnan Ali's avatar Adnan Ali Committed by Alex Reisner
Browse files

use coordinates field from options.

parent 43815f60
No related branches found
No related tags found
No related merge requests found
......@@ -25,9 +25,10 @@ module Geocoder::Store
empty = RUBY_VERSION.split('.')[1].to_i < 9 ? BSON::OrderedHash.new : {}
conds = empty.clone
conds[:coordinates] = empty.clone
conds[:coordinates]["$nearSphere"] = coords.reverse
conds[:coordinates]["$maxDistance"] = \
field = geocoder_options[:coordinates]
conds[field] = empty.clone
conds[field]["$nearSphere"] = coords.reverse
conds[field]["$maxDistance"] = \
Geocoder::Calculations.distance_to_radians(radius, options[:units] || :mi)
if obj = options[:exclude]
......
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