fix: validate portal color format (#14632)

This commit is contained in:
Sivin Varghese
2026-06-03 14:18:19 +05:30
committed by GitHub
parent 7acbe8b3ff
commit 0d59fb4459
+1
View File
@@ -42,6 +42,7 @@ class Portal < ApplicationRecord
validates :name, presence: true
validates :slug, presence: true, uniqueness: true
validates :custom_domain, uniqueness: true, allow_nil: true
validates :color, format: { with: /\A#(?:\h{3}|\h{6})\z/ }, allow_blank: true
validate :config_json_format
scope :active, -> { where(archived: false) }