From a8cf4bd01625ebd341d32ec735a4b885db4c8118 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 18 Jul 2026 16:32:10 +0200 Subject: Accept blank template names in the allowlist validations --- app/models/node.rb | 6 +++--- app/models/page.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/models/node.rb b/app/models/node.rb index b5b18a1..a440c2f 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -31,9 +31,9 @@ class Node < ApplicationRecord validate :reserved_slug_stays_reserved validate :no_head_inside_trash validates :default_template_name, - :inclusion => { :in => ->(_) { Page.custom_templates } }, - :allow_nil => true, - :if => :default_template_name_changed? + :inclusion => { :in => ->(_) { Page.custom_templates } }, + :allow_blank => true, + :if => :default_template_name_changed? # Everything outside the Trash subtree, the Trash node included. # Relies on unique_name being authoritative for tree position -- diff --git a/app/models/page.rb b/app/models/page.rb index c4d66fc..f33d88d 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -17,9 +17,9 @@ class Page < ApplicationRecord # vanished stay saveable -- valid_template already falls back to # standard_template for those at render time. validates :template_name, - :inclusion => { :in => ->(_) { Page.custom_templates } }, - :allow_nil => true, - :if => :template_name_changed? + :inclusion => { :in => ->(_) { Page.custom_templates } }, + :allow_blank => true, + :if => :template_name_changed? # Associations belongs_to :node, optional: true -- cgit v1.3