- doc.find('//osm/modify/node').each do |nd|
- unless NodeController.new.update_internal nil, Node.from_xml_node(nd)
- raise OSM::APIPreconditionFailedError.new
- end
+ doc.find('//osm/modify/relation').each do |nd|
+ elem = XML::Node.new 'relation'
+ new_relation = Relation.from_xml_node(nd)
+ relation = Relation.find(new_relation.id)
+ relation.update_from new_relation, @user
+ elem['old_id'] = elem['new_id'] = relation.id.to_s
+ elem['new_version'] = relation.version.to_s
+ root << elem