Sha256: d09fc3c6725453c157e14cb555f65a7501c33bcbdb80800c3021a3d86ff7b317
Contents?: true
Size: 811 Bytes
Versions: 2
Compression:
Stored size: 811 Bytes
Contents
class Cms::Category < ActiveRecord::Base if ComfortableMexicanSofa.config.database_config && !Rails.env.test? establish_connection "#{ComfortableMexicanSofa.config.database_config}_#{Rails.env}" end set_table_name :cms_categories # -- Relationships -------------------------------------------------------- has_many :categorizations, :dependent => :destroy # -- Validations ---------------------------------------------------------- validates :label, :presence => true, :uniqueness => { :scope => :categorized_type } validates :categorized_type, :presence => true # -- Scopes --------------------------------------------------------------- default_scope order(:label) scope :of_type, lambda { |type| where(:categorized_type => type) } end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
comfortable_mexican_sofa-1.4.7 | app/models/cms/category.rb |
comfortable_mexican_sofa-1.4.6 | app/models/cms/category.rb |