Module: Mongoid

Defined in:
lib/mongoid_nested_set.rb,
lib/mongoid_nested_set/remove_order_by.rb

Overview

This acts provides Nested Set functionality. Nested Set is a smart way to implement an ordered tree, with the added feature that you can select the children and all of their descendants with a single query. The drawback is that insertion or move need multiple queries. But everything is done here by this module!

Nested sets are appropriate each time you want either an ordered tree (menus, commercial categories) or an efficient way of querying big trees (threaded posts).

API

Method names are aligned with acts_as_tree as much as possible to make replacement from one by another easier.

item.children.create(:name => 'child1')

Defined Under Namespace

Modules: Acts, Criterion Classes: Criteria