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

Document changes to nearbys method.

parent ee670d37
No related branches found
No related tags found
No related merge requests found
......@@ -130,9 +130,11 @@ To find objects by location, use the following scopes:
With geocoded objects you can do things like this:
obj.nearbys(30) # other objects within 30 miles
obj.distance_from([40.714,-100.234]) # distance from arbitrary point to object
obj.bearing_to("Paris, France") # direction from object to arbitrary point
if obj.geocoded?
obj.nearbys(30) # other objects within 30 miles
obj.distance_from([40.714,-100.234]) # distance from arbitrary point to object
obj.bearing_to("Paris, France") # direction from object to arbitrary point
end
Some utility methods are also available:
......
......@@ -58,6 +58,7 @@ module Geocoder
##
# Get nearby geocoded objects.
# Takes the same options hash as the near class method (scope).
# Returns nil if the object is not geocoded.
#
def nearbys(radius = 20, options = {})
return nil unless geocoded?
......
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