2020-05-24 23:13:21 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
2021-10-27 15:23:28 +05:30
|
|
|
class FreezePeriod < Ci::ApplicationRecord
|
2020-05-24 23:13:21 +05:30
|
|
|
include StripAttribute
|
2021-10-27 15:23:28 +05:30
|
|
|
include Ci::NamespacedModelName
|
2020-05-24 23:13:21 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
default_scope { order(created_at: :asc) } # rubocop:disable Cop/DefaultScope
|
2020-05-24 23:13:21 +05:30
|
|
|
|
|
|
|
belongs_to :project, inverse_of: :freeze_periods
|
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
strip_attributes! :freeze_start, :freeze_end
|
2020-05-24 23:13:21 +05:30
|
|
|
|
|
|
|
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
|