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

Version Path
c80_yax-0.1.0.25 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.24 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.23 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.22 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.21 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.20 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.18 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.17 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.16 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.15 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.14 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.13 engines/ti/app/models/ti/category.rb