Sha256: 1690582163f09c0a950b4a637f230390c886f76cd03c67169f6c3f719ff85659
Contents?: true
Size: 683 Bytes
Versions: 12
Compression:
Stored size: 683 Bytes
Contents
# frozen_string_literal: true class Occams::Cms::Category < ActiveRecord::Base self.table_name = 'occams_cms_categories' # -- Relationships -------------------------------------------------------- belongs_to :site has_many :categorizations, dependent: :destroy # -- Validations ---------------------------------------------------------- validates :label, presence: true, uniqueness: { scope: %i[categorized_type site_id] } validates :categorized_type, presence: true # -- Scopes --------------------------------------------------------------- scope :of_type, ->(type) { where(categorized_type: type) } end
Version data entries
12 entries across 12 versions & 1 rubygems