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/page.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models/page.rb') diff --git a/app/models/page.rb b/app/models/page.rb index bba7e6bc..3240057f 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -20,6 +20,9 @@ class Page < ApplicationRecord :inclusion => { :in => ->(_) { Page.custom_templates } }, :allow_blank => true, :if => :template_name_changed? + validates :external_url, :format => { :with => %r{\Ahttps?://}i, + :allow_blank => true, + :message => :must_be_http } validates_format_of :slug, :with => /\A[A-Za-z0-9][A-Za-z0-9_-]*\z/, :unless => -> { slug.blank? } validate :page_slug_not_reserved @@ -208,6 +211,7 @@ class Page < ApplicationRecord # Clone untranslated attributes self.slug = page.slug self.parent_node_id = page.parent_node_id + self.external_url = page.external_url self.tag_list = page.tag_list self.template_name ||= page.template_name self.published_at = page.published_at -- cgit v1.3