Sha256: f7f64f2d1466206cecb4c4ce5044a820493e0d4dba4540470fc6ab699080a069
Contents?: true
Size: 845 Bytes
Versions: 18
Compression:
Stored size: 845 Bytes
Contents
class Cms::Category < ActiveRecord::Base ComfortableMexicanSofa.establish_connection(self) self.table_name = 'cms_categories' attr_accessible :label, :categorized_type # -- 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
18 entries across 18 versions & 1 rubygems