]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_way.rb
DateTime => Time for consistency in changeset code, ok by shaun.
[rails.git] / app / models / old_way.rb
index 44155d05c8d58367d0656e62743d1be3dbef2e1d..da9cf0697104ecea39d12db601d17f26e1be8cec 100644 (file)
@@ -5,6 +5,8 @@ class OldWay < ActiveRecord::Base
 
   belongs_to :changeset
 
 
   belongs_to :changeset
 
+  validates_associated :changeset
+  
   def self.from_way(way)
     old_way = OldWay.new
     old_way.visible = way.visible
   def self.from_way(way)
     old_way = OldWay.new
     old_way.visible = way.visible
@@ -96,7 +98,10 @@ class OldWay < ActiveRecord::Base
     el1['id'] = self.id.to_s
     el1['visible'] = self.visible.to_s
     el1['timestamp'] = self.timestamp.xmlschema
     el1['id'] = self.id.to_s
     el1['visible'] = self.visible.to_s
     el1['timestamp'] = self.timestamp.xmlschema
-    el1['user'] = self.changeset.user.display_name if self.changeset.user.data_public?
+    if self.changeset.user.data_public?
+      el1['user'] = self.changeset.user.display_name
+      el1['uid'] = self.changeset.user.id.to_s
+    end
     el1['version'] = self.version.to_s
     el1['changeset'] = self.changeset.id.to_s
     
     el1['version'] = self.version.to_s
     el1['changeset'] = self.changeset.id.to_s