]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/amf_controller.rb
Adding some amf create poi tests. Minor bugfix tweaks to the amf controller
[rails.git] / app / controllers / amf_controller.rb
index 738aa443afc15510e597d128bfe46b6c27618c8a..9c9f85e1dda3e47efda55c553e0b1674971b74d3 100644 (file)
@@ -506,7 +506,8 @@ class AmfController < ApplicationController
 
       if renumberednodes[id]
         id = renumberednodes[id]
-      elsif id <= 0
+      end
+      if id <= 0
         # Create new node
         savenode = true
       else
@@ -573,7 +574,7 @@ class AmfController < ApplicationController
 
   # Save POI to the database.
   # Refuses save if the node has since become part of a way.
-  # Returns:
+  # Returns array with:
   # 0. 0 (success),
   # 1. original node id (unchanged),
   # 2. new node id,
@@ -597,6 +598,7 @@ class AmfController < ApplicationController
     # We always need a new node, based on the data that has been sent to us
     new_node = Node.new
 
+    new_node.id = id
     new_node.changeset_id = changeset
     new_node.version = version
     new_node.lat = lat