return el1
end
- def nearby(radius = 50)
+ def nearby(radius = 50, num = 5)
if self.home_lon and self.home_lat
gc = OSM::GreatCircle.new(self.home_lat, self.home_lon)
bounds = gc.bounds(radius)
else
nearby = []
end
- return nearby
+ return nearby.first(num)
end
def distance(nearby_user)
res = false
@new_friend = new_friend
self.friends.each do |friend|
- if friend.user_id == @new_friend.user_id
+ if friend.friend_user_id == @new_friend.id
return true
end
end