X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/caa20ccc403b1227baf62e951d2f30d13710e80e..c9237a3583ac5720edce034f6bee1f248539191c:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index 306b3dec8..2b21221c0 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -293,9 +293,9 @@ class AmfController < ApplicationController if mid < 0 mid = renumberednodes[mid] if m[0] == 'node' mid = renumberedways[mid] if m[0] == 'way' - if mid - typedmembers << [m[0], mid, m[2]] - end + end + if mid + typedmembers << [m[0], mid, m[2]] end end @@ -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 @@ -487,6 +487,7 @@ class AmfController < ApplicationController way.unshared_node_ids.each do |n| deleteitemrelations(n, 'node') end + deleteitemrelations(way_id, 'way') way.delete_with_relations_and_nodes_and_history(user)