From a1794d3087e6cbd228f3641e7313815d8c59695f Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 20 Aug 2026 17:37:01 +0200 Subject: Surface redirects in nodes#show, the action log and when publishing --- app/models/node_action.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/models/node_action.rb') diff --git a/app/models/node_action.rb b/app/models/node_action.rb index aab1d238..a7036833 100644 --- a/app/models/node_action.rb +++ b/app/models/node_action.rb @@ -200,6 +200,12 @@ class NodeAction < ApplicationRecord old_url, new_url = old_page.external_url, new_page.external_url diff[:external_url] = { "from" => old_url, "to" => new_url } if old_url != new_url + old_redirect, new_redirect = old_page.redirect, new_page.redirect + diff[:redirect] = { "from" => old_redirect, "to" => new_redirect } if old_redirect != new_redirect + + old_target, new_target = old_page.redirect_node&.unique_name, new_page.redirect_node&.unique_name + diff[:redirect_target] = { "from" => old_target, "to" => new_target } if old_target != new_target + old_tags, new_tags = old_page.tag_list.sort, new_page.tag_list.sort diff[:tags] = { "from" => old_tags, "to" => new_tags } if old_tags != new_tags -- cgit v1.3