summaryrefslogtreecommitdiff
path: root/app/controllers/nodes_controller.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-27 11:16:14 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-27 11:16:14 +0200
commit6c20570d2a4c6cb698d0a08dbcb86ecc2a25a131 (patch)
treede502ac778d4a98c927ebaf02cb2338da551e976 /app/controllers/nodes_controller.rb
parent180b5feba092db1339f7bb3217e91f0b22239bc5 (diff)
Pin admin content reads to the default locale
Diffstat (limited to 'app/controllers/nodes_controller.rb')
-rw-r--r--app/controllers/nodes_controller.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb
index 2a2cde33..4ac3d99a 100644
--- a/app/controllers/nodes_controller.rb
+++ b/app/controllers/nodes_controller.rb
@@ -1,4 +1,5 @@
1class NodesController < ApplicationController 1class NodesController < ApplicationController
2 include PinnedToDefaultLocale
2 3
3 # Private 4 # Private
4 5
@@ -18,8 +19,6 @@ class NodesController < ApplicationController
18 :restore_from_trash 19 :restore_from_trash
19 ] 20 ]
20 21
21 around_action :pin_to_default_locale, :only => [:show, :edit, :update, :autosave]
22
23 def index 22 def index
24 @nodes = Node.root.descendants.includes(:head, :draft) 23 @nodes = Node.root.descendants.includes(:head, :draft)
25 .order('id DESC') 24 .order('id DESC')
@@ -295,10 +294,6 @@ class NodesController < ApplicationController
295 end 294 end
296 end 295 end
297 296
298 def pin_to_default_locale
299 Globalize.with_locale(I18n.default_locale) { yield }
300 end
301
302 def descendant_counts_for(ordered_with_level) 297 def descendant_counts_for(ordered_with_level)
303 counts = Hash.new(0) 298 counts = Hash.new(0)
304 stack = [] # [node, level, index] 299 stack = [] # [node, level, index]