require "delegate"
require "validators/date_validator"
require "validators/safe_html_validator"

class CmaCaseValidator < SimpleDelegator
  include ActiveModel::Validations

  validates :title, presence: true
  validates :summary, presence: true
  validates :body, presence: true, safe_html: true

  validates :opened_date, presence: true, date: true
  validates :market_sector, presence: true
  validates :case_type, presence: true
  validates :case_state, presence: true
  validates :closed_date, allow_blank: true, date: true
end

require "delegate"
require "validators/date_validator"
require "validators/safe_html_validator"

class CmaCaseValidator < SimpleDelegator
  include ActiveModel::Validations

  validates :title, presence: true
  validates :summary, presence: true
  validates :body, presence: true, safe_html: true

  validates :opened_date, allow_blank: true, date: true
  validates :market_sector, presence: true
  validates :case_type, presence: true
  validates :case_state, presence: true
  validates :closed_date, allow_blank: true, date: true
end

Allow blank opened dates for CMA cases
Allow blank opened dates for CMA cases

The CMA have some old cases that they don't know the dates for. Allow
blank opened dates to let them edit and publish these documents, and
make the checking of opened dates a content responsibility.
