Sha256: 0e4184b399da15f84d19ea9af329892cb4aa297c81c49094e30fbd6f9283d200
Contents?: true
Size: 431 Bytes
Versions: 12
Compression:
Stored size: 431 Bytes
Contents
module Ti class Category < ActiveRecord::Base has_many :child_categories, class_name: 'Ti::Category', foreign_key: 'parent_category_id', dependent: :nullify belongs_to :parent_category, class_name: 'Ti::Category' has_and_belongs_to_many :docs validates :title, presence: true scope :listed, -> { where(is_listed: true) } default_scope {order(:ord => :asc)} end end
Version data entries
12 entries across 12 versions & 1 rubygems