I’m pleased to announce that the better_nested_set plugin is released.
It ehances acts_as_nested_set, adding methods to move parts of the
Pass them an id or an object.
Other methods added by this mixin are:
* root - root item of the tree (the one that has a nil parent;
should have left_column = 1 too)
* roots - root items, in case of multiple roots (the ones that have
a nil parent)
* level - number indicating the level, a root being level 0
* ancestors - array of all parents, with root as first item
* self_and_ancestors - array of all parents and self
* siblings - array of all siblings, that are the items sharing the
same parent and level
* self_and_siblings - array of itself and all siblings
* children_count - count of all immediate children
* children - array of all immediate childrens
* all_children - array of all children and nested children
* full_set - array of itself and all children and nested children
README and code browsing
It’s in its very early version, though I already use it for three sites.
Some tests and helpers to print trees to come.
Suggestions, reports and comments welcomed.
Symétrie, édition de musique et services multimédia
30 rue Jean-Baptiste Say
69001 LYON (FRANCE)
tél +33 (0)478 29 52 14
fax +33 (0)478 30 01 11