X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bf29550db840c97cafffbe1e836750bef6c7942d..898beb7b7f693cc21b329dab9a22268e3df77446:/app/models/old_way.rb diff --git a/app/models/old_way.rb b/app/models/old_way.rb index 44155d05c..da9cf0697 100644 --- a/app/models/old_way.rb +++ b/app/models/old_way.rb @@ -5,6 +5,8 @@ class OldWay < ActiveRecord::Base belongs_to :changeset + validates_associated :changeset + 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['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