]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_node.rb
Fixing the resync that I had done wrong at the end of last week on the nodes. All...
[rails.git] / app / models / old_node.rb
index 247a699236c46bc76a9dc0e804051a1877709042..0182845282ebc38f4f5d9f14ec1730a94ae8f468 100644 (file)
@@ -1,4 +1,5 @@
-class OldNode < GeoRecord
+class OldNode < ActiveRecord::Base 
+       include GeoRecord
   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'
@@ -83,5 +90,21 @@ class OldNode < GeoRecord
   def tags=(t)
     @tags = t 
   end 
-
+  def tags_as_hash 
+    hash = {} 
+    Tags.split(self.tags) do |k,v| 
+      hash[k] = v 
+    end 
+    hash 
+  end 
+  # Pretend we're not in any ways 
+  def ways 
+    return [] 
+  end 
+  # Pretend we're not in any relations 
+  def containing_relation_members 
+    return [] 
+  end 
 end