2021-08-25 20:09:31 -04:00
|
|
|
# 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-09-29 14:12:42 -04:00
|
|
|
|
|
|
|
scope :enabled, -> { where(enabled: true) }
|
2021-08-25 20:09:31 -04:00
|
|
|
end
|