Sha256: 06050094e97718ca774c73931bfce9e95fc1d8f03088304c141f123d51eb6e09
Contents?: true
Size: 741 Bytes
Versions: 12
Compression:
Stored size: 741 Bytes
Contents
class Comfy::Cms::Category < ActiveRecord::Base self.table_name = 'comfy_cms_categories' # -- Relationships -------------------------------------------------------- belongs_to :site has_many :categorizations, :dependent => :destroy # -- Validations ---------------------------------------------------------- validates :site_id, :presence => true validates :label, :presence => true, :uniqueness => { :scope => [:categorized_type, :site_id] } validates :categorized_type, :presence => true # -- Scopes --------------------------------------------------------------- default_scope{ order(:label) } scope :of_type, lambda { |type| where(:categorized_type => type) } end
Version data entries
12 entries across 12 versions & 1 rubygems