Commit 74bcc8321e5c9eb2f84306d1688ead35f3c86579
1 parent
5921c748
Exists in
spb-stable
and in
2 other branches
Allow set broadcast color with 3 digits like #444
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
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 | 20 | validates :starts_at, presence: true |
| 21 | 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 | 26 | def self.current |
| 27 | 27 | where("ends_at > :now AND starts_at < :now", now: Time.zone.now).last | ... | ... |