diff --git a/app/models/broadcast_message.rb b/app/models/broadcast_message.rb index 85ab7ed6ae8..ce8b7973cd9 100644 --- a/app/models/broadcast_message.rb +++ b/app/models/broadcast_message.rb @@ -20,8 +20,8 @@ class BroadcastMessage < ActiveRecord::Base validates :starts_at, presence: true validates :ends_at, presence: true - validates :color, format: { with: /\A\#[0-9A-Fa-f]{6}+\Z/ }, allow_blank: true - validates :font, format: { with: /\A\#[0-9A-Fa-f]{6}+\Z/ }, allow_blank: true + validates :color, format: { with: /\A\#[0-9A-Fa-f]{3}{1,2}+\Z/ }, allow_blank: true + validates :font, format: { with: /\A\#[0-9A-Fa-f]{3}{1,2}+\Z/ }, allow_blank: true def self.current where("ends_at > :now AND starts_at < :now", now: Time.zone.now).last