Allow set broadcast color with 3 digits like #444
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
5921c74813
commit
74bcc8321e
1 changed files with 2 additions and 2 deletions
|
@ -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…
Reference in a new issue