From 4df88b601b1900c287051d827eaff46f498f60d0 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Wed, 19 Aug 2026 16:05:40 +0200 Subject: Redirect a page to a node or an external URL Page#redirect_target resolves the precedence and returns nil for a destination that is restricted or has no head, so a page with a broken target renders itself rather than linking nowhere. The banner partial will call the same method, so the redirect and the link cannot drift. One hop, no exceptions, checked in publish_draft! rather than as a validation: two nodes publishing concurrently could each pass a save-time check and still produce a chain. "Live" means heads only, a draft redirect that has not published is not yet a link anyone can follow. Node.search excludes redirecting pages. editor_search does not: an editor looking for one searches by title, and only the body is worth hiding. --- db/schema.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 05dc1ef1..888e96f0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.1].define(version: 2026_08_09_135746) do +ActiveRecord::Schema[8.1].define(version: 2026_08_19_124104) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" @@ -150,6 +150,8 @@ ActiveRecord::Schema[8.1].define(version: 2026_08_09_135746) do t.integer "parent_node_id" t.string "preview_token" t.datetime "published_at", precision: nil + t.string "redirect" + t.integer "redirect_node_id" t.integer "revision" t.string "slug" t.string "template_name", limit: 255 -- cgit v1.3