summaryrefslogtreecommitdiff
path: root/app/models/ci/freeze_period.rb
blob: d215372bb450be17c5f6a207b380d76cb96f2861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module Ci
  class FreezePeriod < ApplicationRecord
    include StripAttribute
    self.table_name = 'ci_freeze_periods'

    default_scope { order(created_at: :asc) } # rubocop:disable Cop/DefaultScope

    belongs_to :project, inverse_of: :freeze_periods

    strip_attributes :freeze_start, :freeze_end

    validates :freeze_start, cron: true, presence: true
    validates :freeze_end, cron: true, presence: true
    validates :cron_timezone, cron_freeze_period_timezone: true, presence: true
  end
end