swap way write with node deletion as per dev@
authorRichard Fairhurst <richard@systemed.net>
Tue, 13 Jan 2009 08:37:58 +0000 (08:37 +0000)
committerRichard Fairhurst <richard@systemed.net>
Tue, 13 Jan 2009 08:37:58 +0000 (08:37 +0000)
app/controllers/amf_controller.rb

index 935746ed4fa3aa3298cb2603d6b0ce9c6756756d..2b21221c0b5e560efaa5d4be1f4c191582d52961 100644 (file)
@@ -397,6 +397,14 @@ class AmfController < ApplicationController
          nodes.push(id)
        end
 
+       # -- Save revised way
+
+       way.tags = attributes
+       way.nds = nodes
+       way.user_id = uid
+       way.visible = true
+       way.save_with_history!
+
        # -- Delete any unique nodes
        
        uniques.each do |n|
@@ -408,14 +416,6 @@ class AmfController < ApplicationController
          node.save_with_history!
        end
 
-       # -- Save revised way
-
-       way.tags = attributes
-       way.nds = nodes
-       way.user_id = uid
-       way.visible = true
-       way.save_with_history!
-
        [0, originalway, way.id, renumberednodes]
   end