]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_node.rb
Tidy up a bit after shaun's merge...
[rails.git] / app / models / old_node.rb
index 247a699236c46bc76a9dc0e804051a1877709042..42f55f2d0fbd6db5ef66390e3bd08a192482ceb3 100644 (file)
@@ -1,4 +1,6 @@
-class OldNode < GeoRecord
+class OldNode < ActiveRecord::Base
+  include GeoRecord
+
   set_table_name 'nodes'
   
   validates_presence_of :user_id, :timestamp
@@ -30,6 +32,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 +91,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