]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/amf_controller.rb
Merge pull request #24 from zerebubuth/routing-merge
[rails.git] / app / controllers / amf_controller.rb
index ad337d8a7c6ac025e09b8423f00da56aba858c0f..9dd0e909ec051c18e8c80988150c9b665962ef4f 100644 (file)
@@ -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]