]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/way_controller.rb
Allow objects to be resurrected.
[rails.git] / app / controllers / way_controller.rb
index 20e22bb0f8f78b60b06f6d0f67d1363f31512a2c..acba12def6a7f9f625b8fb78c2745d3eedc06143 100644 (file)
@@ -45,27 +45,22 @@ class WayController < ApplicationController
   def update
     begin
       way = Way.find(params[:id])
+      new_way = Way.from_xml(request.raw_post)
 
-      if way.visible
-        new_way = Way.from_xml(request.raw_post)
-
-        if new_way and new_way.id == way.id
-          if !new_way.preconditions_ok?
-            render :text => "", :status => :precondition_failed
-          else
-            way.user_id = @user.id
-            way.tags = new_way.tags
-            way.nds = new_way.nds
-            way.visible = true
-            way.save_with_history!
-
-            render :nothing => true
-          end
+      if new_way and new_way.id == way.id
+        if !new_way.preconditions_ok?
+          render :text => "", :status => :precondition_failed
         else
-          render :nothing => true, :status => :bad_request
+          way.user_id = @user.id
+          way.tags = new_way.tags
+          way.nds = new_way.nds
+          way.visible = true
+          way.save_with_history!
+
+          render :nothing => true
         end
       else
-        render :text => "", :status => :gone
+        render :nothing => true, :status => :bad_request
       end
     rescue ActiveRecord::RecordNotFound
       render :nothing => true, :status => :not_found