From 0d59fb44590b61d1b19d3366d03a765c98f5c423 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Wed, 3 Jun 2026 14:18:19 +0530 Subject: [PATCH] fix: validate portal color format (#14632) --- app/models/portal.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/portal.rb b/app/models/portal.rb index 41c4d3edd..37665a15c 100644 --- a/app/models/portal.rb +++ b/app/models/portal.rb @@ -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) }