X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c253ce33997451b6b44777254b38a364d597c492..0be6dd860f1843681e6380fbe69ca71a6eb01ab7:/app/models/node.rb diff --git a/app/models/node.rb b/app/models/node.rb index 3481e28ca..391b50dcd 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -83,7 +83,7 @@ class Node < ActiveRecord::Base # version must be present unless creating return nil unless create or not pt['version'].nil? - node.version = pt['version'].to_i + node.version = create ? 0 : pt['version'].to_i unless create if pt['id'] != '0' @@ -222,7 +222,10 @@ class Node < ActiveRecord::Base user_display_name_cache[self.changeset.user_id] = nil end - el1['user'] = user_display_name_cache[self.changeset.user_id] unless user_display_name_cache[self.changeset.user_id].nil? + if not user_display_name_cache[self.changeset.user_id].nil? + el1['user'] = user_display_name_cache[self.changeset.user_id] + el1['uid'] = self.changeset.user_id.to_s + end self.tags.each do |k,v| el2 = XML::Node.new('tag')