summaryrefslogtreecommitdiff
path: root/app/controllers/nodes_controller.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-06 04:17:29 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-06 04:17:29 +0200
commitcb16e35c5f9fc93a3382391de496153515cf05ca (patch)
tree4833c790deb177d93262ee4ac3f43899a48a44ca /app/controllers/nodes_controller.rb
parent0d91c5a4aa47fa34e0dfe6742b94aa23d59544bc (diff)
Preload page titles for the sitemap, and order containers before leaves
Diffstat (limited to 'app/controllers/nodes_controller.rb')
-rw-r--r--app/controllers/nodes_controller.rb6
1 files changed, 6 insertions, 0 deletions
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
256 256
257 def sitemap 257 def sitemap
258 @sitemap = Node.root.self_and_descendants_ordered_with_level 258 @sitemap = Node.root.self_and_descendants_ordered_with_level
259
260 ActiveRecord::Associations::Preloader.new(
261 :records => @sitemap.map(&:first),
262 :associations => [{ :head => :translations }, { :draft => :translations }]
263 ).call
264
259 @sitemap_descendant_counts = descendant_counts_for(@sitemap) 265 @sitemap_descendant_counts = descendant_counts_for(@sitemap)
260 end 266 end
261 267