X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/0cc579b2875a1f31d4425cc90378fd8cbf934974..1f7bd08f4a8a6a626a0c1d7ed60f2dcd6a6801e8:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index ad337d8a7..9dd0e909e 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -321,12 +321,12 @@ class AmfController < ApplicationController # Ideally we would do ":include => :nodes" here but if we do that # then rails only seems to return the first copy of a node when a # way includes a node more than once - way = Way.where(:id => wayid).preload(:nodes => :node_tags).first + way = Way.where(:id => wayid).first # check case where way has been deleted or doesn't exist return [-4, 'way', wayid] if way.nil? or !way.visible - points = way.nodes.collect do |node| + points = way.nodes.preload(:node_tags).collect do |node| nodetags=node.tags nodetags.delete('created_by') [node.lon, node.lat, node.id, nodetags, node.version]