]> git.openstreetmap.org Git - rails.git/commitdiff
Use configuration variables for limiting nearby users, and bump the number to 30
authorAndy Allan <andy@gravitystorm.co.uk>
Fri, 17 Dec 2010 13:18:26 +0000 (13:18 +0000)
committerAndy Allan <andy@gravitystorm.co.uk>
Fri, 17 Dec 2010 13:18:26 +0000 (13:18 +0000)
app/models/user.rb
config/example.application.yml

index 1db8adab7fcea045f4b1a05516859a57aa579043..c2d73ed98c45d2ff320f435e382f153f1dc33419 100644 (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)
index c88d894a0773980e6ba8569472c30e30e79e9ce5..303c5626a9f385b9c52e8a821d0b313fe1d0ab64 100644 (file)
@@ -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