]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/way_controller.rb
Fixed up delete methods on nodes, ways and relations to return the new version number...
[rails.git] / app / controllers / way_controller.rb
index e7cf0f7f1cf2c140f76331636fe5355af0553eff..b00658cf08e7c4deab178b03e8fccf06f54eb05d 100644 (file)
@@ -67,11 +67,10 @@ class WayController < ApplicationController
     begin
       way = Way.find(params[:id])
       new_way = Way.from_xml(request.raw_post)
-      if new_way and new_way.id == way.id
-        way.delete_with_history(@user)
 
-        # if we get here, all is fine, otherwise something will catch below.  
-        render :nothing => true
+      if new_way and new_way.id == way.id
+        way.delete_with_history!(new_way, @user)
+        render :text => way.version.to_s, :content_type => "text/plain"
       else
         render :nothing => true, :status => :bad_request
       end