Return usernames correctly.
[rails.git] / app / models / way.rb
index 090c7a739f9bf7344d237528d9460024c6550186..d5d2dc98ef8b11ee92173c090862ccf7ad8aab44 100644 (file)
@@ -60,12 +60,13 @@ class Way < ActiveRecord::Base
     
     if user_display_name_cache and user_display_name_cache[self.user_id]
       # use the cache if available
-    else
+    elsif self.user.data_public?
       user_display_name_cache[self.user_id] = self.user.display_name
+    else
+      user_display_name_cache[self.user_id] = nil
     end
-    
-    #el1['user'] = self.user.display_name if self.user.data_public?
-    el1['user'] = user_display_name_cache[self.user_id]
+
+    el1['user'] = user_display_name_cache[self.user_id] unless user_display_name_cache[self.user_id].nil?
 
     # make sure segments are output in sequence_id order
     ordered_segments = []