patch from Martijn van Oosterhout
This commit is contained in:
parent
0f6d05a2d7
commit
f01f820f6c
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ class User < ActiveRecord::Base
|
|||
|
||||
def nearby(lat_range=1, lon_range=1)
|
||||
if self.home_lon and self.home_lat
|
||||
nearby = User.find(:all, :conditions => "#{self.home_lon} > home_lon - #{lon_range} and #{self.home_lon} < home_lon + #{lon_range} and #{self.home_lon} > home_lon - #{lon_range} and #{self.home_lon} < home_lon + #{lon_range} and data_public = 1 and id != #{self.id}")
|
||||
nearby = User.find(:all, :conditions => "#{self.home_lon} > home_lon - #{lon_range} and #{self.home_lon} < home_lon + #{lon_range} and #{self.home_lat} > home_lat - #{lat_range} and #{self.home_lat} < home_lat + #{lat_range} and data_public = 1 and id != #{self.id}")
|
||||
else
|
||||
nearby = []
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue