diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-18 16:32:10 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-18 16:32:10 +0200 |
| commit | a8cf4bd01625ebd341d32ec735a4b885db4c8118 (patch) | |
| tree | 6a42ea2a86a907cc13c9a6447d990ffa3b145a2c /app/models/page.rb | |
| parent | 0c6783816e0a7a8acad922296d3eb8cc454fb981 (diff) | |
Accept blank template names in the allowlist validations
Diffstat (limited to 'app/models/page.rb')
| -rw-r--r-- | app/models/page.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 | |||
| 17 | # vanished stay saveable -- valid_template already falls back to | 17 | # vanished stay saveable -- valid_template already falls back to |
| 18 | # standard_template for those at render time. | 18 | # standard_template for those at render time. |
| 19 | validates :template_name, | 19 | validates :template_name, |
| 20 | :inclusion => { :in => ->(_) { Page.custom_templates } }, | 20 | :inclusion => { :in => ->(_) { Page.custom_templates } }, |
| 21 | :allow_nil => true, | 21 | :allow_blank => true, |
| 22 | :if => :template_name_changed? | 22 | :if => :template_name_changed? |
| 23 | 23 | ||
| 24 | # Associations | 24 | # Associations |
| 25 | belongs_to :node, optional: true | 25 | belongs_to :node, optional: true |
