From: Steve Coast Date: Mon, 14 May 2007 00:51:36 +0000 (+0000) Subject: do wot john said innit - eagerly load tags in the map call for ways X-Git-Tag: live~8432 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/332bcb6b181109d56fc8b30ae78ade3961849a83 do wot john said innit - eagerly load tags in the map call for ways --- diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 35a0f25b7..fd9ce22ed 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -186,7 +186,7 @@ class ApiController < ApplicationController if segment_ids.length > 0 way_segments = WaySegment.find_all_by_segment_id(segment_ids) way_ids = way_segments.collect {|way_segment| way_segment.id } - ways = Way.find(way_ids) # NB: doesn't pick up segments, tags from db until accessed via way.way_segments etc. + ways = Way.find(way_ids, :include => [:way_tags]) # NB: doesn't pick up segments, tags from db until accessed via way.way_segments etc. # seg_ids = way_segments.collect {|way_segment| way_segment.segment_id }