From df11677afd55ef592330a05c43ed4baa81b60572 Mon Sep 17 00:00:00 2001 From: Christopher Schmidt Date: Sun, 11 May 2008 22:27:40 +0000 Subject: [PATCH] from_xml sets a version on nodes --- app/models/node.rb | 3 ++- app/models/relation.rb | 2 ++ app/models/way.rb | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/node.rb b/app/models/node.rb index 7a103efa5..acd251918 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -66,7 +66,8 @@ class Node < GeoRecord def self.from_xml_node(pt, create=false) node = Node.new - + + node.version = pt['version'] node.lat = pt['lat'].to_f node.lon = pt['lon'].to_f diff --git a/app/models/relation.rb b/app/models/relation.rb index 58add6dd0..b7cb0f15b 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -31,6 +31,8 @@ class Relation < ActiveRecord::Base relation.id = pt['id'].to_i end + relation.version = pt['version'] + if create relation.timestamp = Time.now relation.visible = true diff --git a/app/models/way.rb b/app/models/way.rb index 255f4329f..de69f7565 100644 --- a/app/models/way.rb +++ b/app/models/way.rb @@ -31,6 +31,8 @@ class Way < ActiveRecord::Base if !create and pt['id'] != '0' way.id = pt['id'].to_i end + + way.version = pt['version'] if create way.timestamp = Time.now -- 2.43.2