]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/relation.rb
Rather than referring how to view a bbox history, just redirect to the global history.
[rails.git] / app / models / relation.rb
index 94ef9d42a8f39552ffe59804b305b86c69e630d7..64af4ecc1eb9d59eff27e8b46d292f3a2aa560f6 100644 (file)
@@ -27,8 +27,7 @@ class Relation < ActiveRecord::Base
 
   def self.from_xml(xml, create=false)
     begin
-      p = XML::Parser.new
-      p.string = xml
+      p = XML::Parser.string(xml)
       doc = p.parse
 
       doc.find('//osm/relation').each do |pt|
@@ -49,6 +48,8 @@ class Relation < ActiveRecord::Base
     raise OSM::APIBadXMLError.new("relation", pt, "You are missing the required changeset in the relation") if pt['changeset'].nil?
     relation.changeset_id = pt['changeset']
 
+    # The follow block does not need to be executed because they are dealt with 
+    # in create_with_history, update_from and delete_with_history
     if create
       relation.timestamp = Time.now
       relation.visible = true