From 1a037ac6fab34c5f65ed0f37ed603b88e7b02fd1 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 8 Aug 2026 02:46:06 +0200 Subject: Move the external homepage onto the draft --- app/models/node.rb | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'app/models/node.rb') diff --git a/app/models/node.rb b/app/models/node.rb index 5c28a786..f5b76b45 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -42,9 +42,6 @@ class Node < ApplicationRecord :inclusion => { :in => ->(_) { Page.custom_templates } }, :allow_blank => true, :if => :default_template_name_changed? - validates :external_url, :format => { :with => %r{\Ahttps?://}i, - :allow_blank => true, - :message => :must_be_http } # Everything outside the Trash subtree, the Trash node included. # Relies on unique_name being authoritative for tree position -- @@ -260,6 +257,8 @@ class Node < ApplicationRecord self.slug = self.head.slug end + self.external_url = self.head.external_url + if self.head.parent_node_id && self.head.parent_node_id != parent_id new_parent = Node.find_by(:id => self.head.parent_node_id) @@ -604,23 +603,6 @@ class Node < ApplicationRecord self.created_at < new_id_format_date ? unique_path : id end - def update_external_url!(url, current_user = nil) - normalised = url.presence - return false if normalised == external_url - - guard_live_change!(current_user) - previous = external_url - - transaction do - update!(:external_url => normalised) - NodeAction.record!(:node => self, :user => current_user, - :action => "node_external_url", - :path => unique_name, - :external_url => { "from" => previous, "to" => normalised }) - end - true - end - # Full-text search across all locale translations using PostgreSQL tsvector. # Uses 'simple' dictionary (no stemming, no stopwords) so queries work # across German and English content without language detection. -- cgit v1.3