X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/2c5f6740c74dd754e162bac26db6e9b405234274..3d24694addd628cc55a3d2a24d736e61cbd55273:/app/controllers/relation_controller.rb?ds=sidebyside diff --git a/app/controllers/relation_controller.rb b/app/controllers/relation_controller.rb index d87905059..b77d41ead 100644 --- a/app/controllers/relation_controller.rb +++ b/app/controllers/relation_controller.rb @@ -68,7 +68,13 @@ class RelationController < ApplicationController #XXX check if member somewhere! begin relation = Relation.find(params[:id]) - relation.delete_with_history(@user) + 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, :status => :success + else + render :nothing => true, :status => :bad_request + end rescue OSM::APIError => ex render ex.render_opts rescue ActiveRecord::RecordNotFound