Class: DcCategory
- Inherits:
-
Object
- Object
- DcCategory
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- app/models/dc_category.rb
Overview
Schema information
Collection name: dc_category : Categories
_id BSON::ObjectId _id
created_at Time created_at
updated_at Time Last update
name String Category name
description String Additional description of category
ctype Integer Category type. Could be used for grouping categories.
parent BSON::ObjectId Parent category. Leave blank if this is top level category.
active Mongoid::Boolean Category is active.
order Integer Additional order, which can be used for sorting.
created_by BSON::ObjectId created_by
updated_by BSON::ObjectId updated_by
Categories are used on DcPage documents for grouping documents. Categorization is most useful for grouping news, blog entries …
Class Method Summary collapse
-
.values_for_parent ⇒ Object
Returns all values where parent value is nil (top level parent).
Class Method Details
.values_for_parent ⇒ Object
Returns all values where parent value is nil (top level parent).
65 66 67 |
# File 'app/models/dc_category.rb', line 65 def self.values_for_parent #:nodoc: where(parent: nil).sort(name: 1).inject([]) {|r,v| r << [v.name, v._id]} end |