Sha256: 6b10a99f64578910e4300aea23b3f1092a616c08dddb30d8e3e1d37a9f8dc4d7

Contents?: true

Size: 342 Bytes

Versions: 4

Compression:

Stored size: 342 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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
c80_yax-0.1.0.12 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.11 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.10 engines/ti/app/models/ti/category.rb
c80_yax-0.1.0.9 engines/ti/app/models/ti/category.rb