debian-mirror-gitlab/app/models/dependency_proxy/image_ttl_group_policy.rb

14 lines
357 B
Ruby
Raw Normal View History

2021-11-11 11:23:49 +05:30
# frozen_string_literal: true
class DependencyProxy::ImageTtlGroupPolicy < ApplicationRecord
self.primary_key = :group_id
belongs_to :group
validates :group, presence: true
validates :enabled, inclusion: { in: [true, false] }
validates :ttl, numericality: { greater_than: 0 }, allow_nil: true
2021-11-18 22:05:49 +05:30
scope :enabled, -> { where(enabled: true) }
2021-11-11 11:23:49 +05:30
end