diff options
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/nodes_controller.rb | 6 |
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 | ||
