show nearest 10 users (request by Blackadder)

This commit is contained in:
Richard Fairhurst 2007-11-28 22:07:24 +00:00
parent b82c10bcd1
commit 914cad0aa2

View file

@ -74,7 +74,7 @@ class User < ActiveRecord::Base
return el1 return el1
end end
def nearby(radius = 50, num = 5) def nearby(radius = 50, num = 10)
if self.home_lon and self.home_lat if self.home_lon and self.home_lat
gc = OSM::GreatCircle.new(self.home_lat, self.home_lon) gc = OSM::GreatCircle.new(self.home_lat, self.home_lon)
bounds = gc.bounds(radius) bounds = gc.bounds(radius)