Hi,
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
tree, like:
* move_to_child_of
* move_to_right_of
* move_to_left_of
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
Subversion repository:
http://opensource.symetrie.com/svn/better_nested_set/trunk
README and code browsing
http://opensource.symetrie.com/trac/better_nested_set
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.
Jean-Christophe Michel
--
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
web www.symetrie.com