From ec7d43efdb0699da0c0c90fc535d587c6529992a Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Tue, 29 Mar 2011 18:19:59 -0400 Subject: [PATCH] Add sort by distance example. --- README.rdoc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index 8eb206dd..01ffe018 100644 --- a/README.rdoc +++ b/README.rdoc @@ -106,7 +106,11 @@ When you run a location-aware query the returned objects have two attributes add * <tt>obj.distance</tt> - number of miles from the search point to this object * <tt>obj.bearing</tt> - direction from the search point to this object -The bearing is given as a number (between 0 and 360): clockwise degrees from due north. Some examples: +You can take advantage of this to, for example, sort results by distance: + + Place.near([54.2,2.1]).order("distance") + +Bearing is given as a number (between 0 and 360): clockwise degrees from due north, for example: * +0+ - due north * +180+ - due south -- GitLab