Skip to content
Snippets Groups Projects
Verified Commit 74bcc832 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Allow set broadcast color with 3 digits like #444

parent 5921c748
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment