From cb16e35c5f9fc93a3382391de496153515cf05ca Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 6 Aug 2026 04:17:29 +0200 Subject: Preload page titles for the sitemap, and order containers before leaves --- app/controllers/nodes_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/controllers') diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 447d596d..5b919b1f 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb @@ -256,6 +256,12 @@ class NodesController < ApplicationController def sitemap @sitemap = Node.root.self_and_descendants_ordered_with_level + + ActiveRecord::Associations::Preloader.new( + :records => @sitemap.map(&:first), + :associations => [{ :head => :translations }, { :draft => :translations }] + ).call + @sitemap_descendant_counts = descendant_counts_for(@sitemap) end -- cgit v1.3