Commit 781efd183a476986b45f5a9bc407c037f9f14f5f

Authored by Dmitriy Zaporozhets
2 parents 5921c748 74bcc832

Merge branch 'broadcast-3-digit-colors' into 'master'

Broadcast 3 digit colors
Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
app/models/broadcast_message.rb
@@ -20,8 +20,8 @@ class BroadcastMessage < ActiveRecord::Base @@ -20,8 +20,8 @@ class BroadcastMessage < ActiveRecord::Base
20 validates :starts_at, presence: true 20 validates :starts_at, presence: true
21 validates :ends_at, presence: true 21 validates :ends_at, presence: true
22 22
23 - validates :color, format: { with: /\A\#[0-9A-Fa-f]{6}+\Z/ }, allow_blank: true  
24 - validates :font, format: { with: /\A\#[0-9A-Fa-f]{6}+\Z/ }, allow_blank: true 23 + validates :color, format: { with: /\A\#[0-9A-Fa-f]{3}{1,2}+\Z/ }, allow_blank: true
  24 + validates :font, format: { with: /\A\#[0-9A-Fa-f]{3}{1,2}+\Z/ }, allow_blank: true
25 25
26 def self.current 26 def self.current
27 where("ends_at > :now AND starts_at < :now", now: Time.zone.now).last 27 where("ends_at > :now AND starts_at < :now", now: Time.zone.now).last