Eager load nodes and node tags for the way when doing a getway call.
authorTom Hughes <tom@compton.nu>
Tue, 28 Apr 2009 15:55:54 +0000 (15:55 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 28 Apr 2009 15:55:54 +0000 (15:55 +0000)
app/controllers/amf_controller.rb

index d88c5ac191fc666475b11aa257be6169c254cfe6..9004397218ddcbc47e2e8a43b5761c6266a35ab8 100644 (file)
@@ -266,7 +266,7 @@ class AmfController < ApplicationController
         # then rails only seems to return the first copy of a node when a
         # way includes a node more than once
         begin
-          way = Way.find(wayid)
+          way = Way.find(wayid, :include => { :nodes => :node_tags })
         rescue ActiveRecord::RecordNotFound
           return [wayid,[],{}]
         end