Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-04 12:04:36 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-04 12:04:36 +0400
commit74bcc8321e5c9eb2f84306d1688ead35f3c86579 (patch)
tree76e2c630f72c362327127083ca07c06408efc738 /app/models/broadcast_message.rb
parent5921c7481302913bffe88788c354f415cd19df82 (diff)
Allow set broadcast color with 3 digits like #444
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/broadcast_message.rb')
-rw-r--r--app/models/broadcast_message.rb4
1 files changed, 2 insertions, 2 deletions
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