From b462b7131ecb4af1d6947ab65816b4bfe728b418 Mon Sep 17 00:00:00 2001 From: Manu Date: Wed, 16 Jan 2019 12:08:25 -0500 Subject: [PATCH] validations were added for the process banner --- app/models/legislation/process.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index 36a606314..974546ff4 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -44,6 +44,8 @@ class Legislation::Process < ActiveRecord::Base validates :allegations_end_date, presence: true, if: :allegations_start_date? validates :proposals_phase_end_date, presence: true, if: :proposals_phase_start_date? validate :valid_date_ranges + validates :background_color, format: { allow_blank: true, with: /\A#?(?:[A-F0-9]{3}){1,2}\z/i } + validates :font_color, format: { allow_blank: true, with: /\A#?(?:[A-F0-9]{3}){1,2}\z/i } scope :open, -> { where("start_date <= ? and end_date >= ?", Date.current, Date.current) .order('id DESC') }