add to_xml method for oldnode
authorChristopher Schmidt <crschmidt@crschmidt.net>
Sun, 11 May 2008 22:26:46 +0000 (22:26 +0000)
committerChristopher Schmidt <crschmidt@crschmidt.net>
Sun, 11 May 2008 22:26:46 +0000 (22:26 +0000)
app/models/old_node.rb

index 247a699236c46bc76a9dc0e804051a1877709042..5d9c6d7ef31d7c8ecf57d738b92ea82021ff266e 100644 (file)
@@ -1,4 +1,5 @@
 class OldNode < GeoRecord
+  set_primary_keys :id, :version
   set_table_name 'nodes'
   
   validates_presence_of :user_id, :timestamp
@@ -30,6 +31,12 @@ class OldNode < GeoRecord
     old_node.version = node.version
     return old_node
   end
+  
+  def to_xml
+    doc = OSM::API.new.get_xml_doc
+    doc.root << to_xml_node()
+    return doc
+  end
 
   def to_xml_node
     el1 = XML::Node.new 'node'