From 6d51e778806f841409af9ae4026618f9bdc813b4 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Fri, 17 Dec 2010 13:18:26 +0000 Subject: [PATCH] Use configuration variables for limiting nearby users, and bump the number to 30 --- app/models/user.rb | 2 +- config/example.application.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 1db8adab7..c2d73ed98 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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) diff --git a/config/example.application.yml b/config/example.application.yml index c88d894a0..303c5626a 100644 --- a/config/example.application.yml +++ b/config/example.application.yml @@ -41,6 +41,10 @@ standard_settings: &standard_settings # Quova authentication details #quova_username: "" #quova_password: "" + # Users to show as being nearby + nearby_users: 30 + # Max radius, in km, for nearby users + nearby_radius: 50 # Spam threshold spam_threshold: 50 # Default legale (jurisdiction location) for contributor terms -- 2.43.2