From 278819cad2d2199029cc11124c95b0155f83f821 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 7 Aug 2026 20:22:37 +0200 Subject: Show a pending address in the cockpit, the diff and the publish confirm --- app/models/page.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/models/page.rb') diff --git a/app/models/page.rb b/app/models/page.rb index 4635f1b4..bba7e6bc 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -272,6 +272,7 @@ class Page < ApplicationRecord end text_diffs.merge( + address: address_diff_against(other), tags: { added: tag_list.to_a - other.tag_list.to_a, removed: other.tag_list.to_a - tag_list.to_a }, template_name: { from: other.template_name, to: template_name, changed: template_name != other.template_name }, assets: { added: assets.to_a - other.assets.to_a, removed: other.assets.to_a - assets.to_a } @@ -417,4 +418,12 @@ class Page < ApplicationRecord self.body = doc.to_html end + + def address_diff_against other + changed = slug != other.slug || parent_node_id != other.parent_node_id + + { :from => other.prospective_unique_name, + :to => prospective_unique_name, + :changed => changed } + end end -- cgit v1.3