X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0e2a66e8de55b3719bd307261058b7f898598994..d5d92e60564dcd322a736c4bd3ddf831631d9c0e:/app/models/old_way.rb diff --git a/app/models/old_way.rb b/app/models/old_way.rb index e239da161..991925102 100644 --- a/app/models/old_way.rb +++ b/app/models/old_way.rb @@ -124,12 +124,10 @@ class OldWay < ApplicationRecord curnode = Node.find(n) id = n reuse = curnode.visible - if oldnode.lat != curnode.lat || oldnode.lon != curnode.lon || oldnode.tags != curnode.tags - # node has changed: if it's in other ways, give it a new id - if curnode.ways - [way_id] - id = -1 - reuse = false - end + # if node has changed and it's in other ways, give it a new id + if !curnode.ways.all?(way_id) && (oldnode.lat != curnode.lat || oldnode.lon != curnode.lon || oldnode.tags != curnode.tags) + id = -1 + reuse = false end points << [oldnode.lon, oldnode.lat, id, curnode.version, oldnode.tags_as_hash, reuse] end