]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/relation_controller.rb
Prepare for Rails 2.1+, as we will no longer be able to use a symbol in the set_fixtu...
[rails.git] / app / controllers / relation_controller.rb
index 4b3fdf34fe7342851b5801f2c0a13702c097b721..da5129467ff1e72caba2f35da5815804eb285008 100644 (file)
@@ -67,8 +67,8 @@ class RelationController < ApplicationController
       relation = Relation.find(params[:id])
       new_relation = Relation.from_xml(request.raw_post)
       if new_relation and new_relation.id == relation.id
-        relation.delete_with_history(new_relation, @user)
-        render :nothing => true
+        relation.delete_with_history!(new_relation, @user)
+        render :text => relation.version.to_s, :content_type => "text/plain"
       else
         render :nothing => true, :status => :bad_request
       end
@@ -185,7 +185,7 @@ class RelationController < ApplicationController
     doc = OSM::API.new.get_xml_doc
 
     Relation.find(relationids).each do |relation|
-      doc.root << relation.to_xml_node
+      doc.root << relation.to_xml_node if relation.visible
     end
 
     render :text => doc.to_s, :content_type => "text/xml"