From 8675f6b352fe0d15e27fe2302eeb3611723bc83a Mon Sep 17 00:00:00 2001 From: Mahmoud Hanafy Date: Tue, 27 May 2025 07:43:54 +0100 Subject: [PATCH] Include changeset with node instead of loading it while rendering Related to this issue: https://github.com/openstreetmap/openstreetmap-website/issues/6057 --- app/controllers/api/maps_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/maps_controller.rb b/app/controllers/api/maps_controller.rb index 439585462..ebe838a93 100644 --- a/app/controllers/api/maps_controller.rb +++ b/app/controllers/api/maps_controller.rb @@ -28,7 +28,7 @@ module Api return end - nodes = Node.bbox(@bounds).where(:visible => true).includes(:node_tags).limit(Settings.max_number_of_nodes + 1) + nodes = Node.bbox(@bounds).where(:visible => true).includes(:node_tags, :changeset).limit(Settings.max_number_of_nodes + 1) node_ids = nodes.collect(&:id) if node_ids.length > Settings.max_number_of_nodes @@ -52,7 +52,7 @@ module Api # - [0] in case some thing links to node 0 which doesn't exist. Shouldn't actually ever happen but it does. FIXME: file a ticket for this nodes_to_fetch = (list_of_way_nodes.uniq - node_ids) - [0] - nodes += Node.includes(:node_tags).find(nodes_to_fetch) unless nodes_to_fetch.empty? + nodes += Node.includes(:node_tags, :changeset).find(nodes_to_fetch) unless nodes_to_fetch.empty? @nodes = nodes.filter(&:visible?) -- 2.39.5