summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-19 16:05:40 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-19 16:05:40 +0200
commit4df88b601b1900c287051d827eaff46f498f60d0 (patch)
treeb6db47fbb256dc68601f2aa31430d8636018f115 /db
parentedf0d64aa2c837b4bb28787483f98cb4815601c2 (diff)
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.
Diffstat (limited to 'db')
-rw-r--r--db/schema.rb4
1 files changed, 3 insertions, 1 deletions
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 @@
10# 10#
11# It's strongly recommended that you check this file into your version control system. 11# It's strongly recommended that you check this file into your version control system.
12 12
13ActiveRecord::Schema[8.1].define(version: 2026_08_09_135746) do 13ActiveRecord::Schema[8.1].define(version: 2026_08_19_124104) do
14 # These are extensions that must be enabled in order to support this database 14 # These are extensions that must be enabled in order to support this database
15 enable_extension "pg_catalog.plpgsql" 15 enable_extension "pg_catalog.plpgsql"
16 16
@@ -150,6 +150,8 @@ ActiveRecord::Schema[8.1].define(version: 2026_08_09_135746) do
150 t.integer "parent_node_id" 150 t.integer "parent_node_id"
151 t.string "preview_token" 151 t.string "preview_token"
152 t.datetime "published_at", precision: nil 152 t.datetime "published_at", precision: nil
153 t.string "redirect"
154 t.integer "redirect_node_id"
153 t.integer "revision" 155 t.integer "revision"
154 t.string "slug" 156 t.string "slug"
155 t.string "template_name", limit: 255 157 t.string "template_name", limit: 255