]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/way_controller.rb
api06: s/delete_with_relations_and_history/delete_with_history/g
[rails.git] / app / controllers / way_controller.rb
index 94a10d4242778335bf1043a2c26d71a9b86f37d4..21f2ea76567cc639f669724232e904b510a7a53e 100644 (file)
@@ -58,6 +58,9 @@ class WayController < ApplicationController
       end
     rescue OSM::APIPreconditionFailedError
       render :text => "", :status => :precondition_failed
+    rescue OSM::APIVersionMismatchError => ex
+      render :text => "Version mismatch: Provided " + ex.provided.to_s +
+       ", server had: " + ex.latest.to_s, :status => :bad_request
     rescue ActiveRecord::RecordNotFound
       render :nothing => true, :status => :not_found
     end
@@ -67,7 +70,7 @@ class WayController < ApplicationController
   def delete
     begin
       way = Way.find(params[:id])
-      way.delete_with_relations_and_history(@user)
+      way.delete_with_history(@user)
 
       # if we get here, all is fine, otherwise something will catch below.  
       render :nothing => true