Use configuration variables for limiting nearby users, and bump the number to 30

This commit is contained in:
Andy Allan 2010-12-17 13:18:26 +00:00
parent b5e28f092f
commit 6d51e77880
2 changed files with 5 additions and 1 deletions

View file

@ -107,7 +107,7 @@ class User < ActiveRecord::Base
(languages & array.collect { |i| i.to_s }).first
end
def nearby(radius = 50, num = 10)
def nearby(radius = NEARBY_RADIUS, num = NEARBY_USERS)
if self.home_lon and self.home_lat
gc = OSM::GreatCircle.new(self.home_lat, self.home_lon)
bounds = gc.bounds(radius)