X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/e9527b363da441337ac8c44c9d3d3feada3eaa9c..bed9cd00ed166ce346da4b8a9b654ddf86e64e70:/app/models/relation.rb diff --git a/app/models/relation.rb b/app/models/relation.rb index 94ef9d42a..64af4ecc1 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -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