summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-31 22:36:17 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-31 22:36:17 +0200
commit529f81b28ed77c62acaa63fad957e751798f2440 (patch)
tree9d928cbe54008b1f75c4b813182970dd0757002c /app/models
parent3b4e1423635fd9f33ae760312e438cc1e484662e (diff)
Warn before the gate refuses, and check restore destinations
nodes#new marks the kinds that place under /updates, derived from each kind's own path_prefix. The three parent pickers mark candidates the current user cannot publish into; menu_search returns needs_redaktion per result, computed per user rather than as a bare restricted flag, and the menu-item picker opts out. restore_from_trash! checks its destination: the restore is the move, applied rather than staged, so no later publish would have caught it. The node returns as a draft either way.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/node.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index 188b6c17..d6fe32ff 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -375,6 +375,9 @@ class Node < ApplicationRecord
375 raise ActiveRecord::RecordInvalid.new(self) 375 raise ActiveRecord::RecordInvalid.new(self)
376 end 376 end
377 377
378 guard_live_change!(current_user,
379 :target_path => [new_parent.unique_name.presence, slug].compact.join("/"))
380
378 ActiveRecord::Base.transaction do 381 ActiveRecord::Base.transaction do
379 path_before = unique_name 382 path_before = unique_name
380 move_to_child_of(new_parent) 383 move_to_child_of(new_parent)