projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7bcda27
)
Don't list yourself in the nearby mappers
author
John McKerrell
<john@mckerrell.net>
Sat, 5 May 2007 15:00:16 +0000
(15:00 +0000)
committer
John McKerrell
<john@mckerrell.net>
Sat, 5 May 2007 15:00:16 +0000
(15:00 +0000)
app/models/user.rb
patch
|
blob
|
history
diff --git
a/app/models/user.rb
b/app/models/user.rb
index f7a4122a3afa9c3b56ec897ff7d4ac71eaf0d3b1..1261e5a181ec46886f568344d815b2ff9a1d0b24 100644
(file)
--- a/
app/models/user.rb
+++ b/
app/models/user.rb
@@
-62,7
+62,7
@@
class User < ActiveRecord::Base
def nearby(lat_range=1, lon_range=1)
if self.home_lon and self.home_lat
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")
+ 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}
")
else
nearby = []
end
else
nearby = []
end