Implementation for methods that returns children, all children (including children of children) with root node itself.
Added self_and_children, all_children and self_and_all_children metho…
…ds and test for them.
Refactor all_children method
Thanks for contributing, I like the API. Just have one query regarding all_children. The ordering of all children is a concern I think. If one is treating the tree like windows explorer does, then the current ordering makes sense. But IMO, we should have the options of specifying the order of traversal (depth-first, breadth-first etc) instead of just sticking to one default.
I haven't really thought about the API for that, but if you have something in mind, please let me know.
I was thinking about it and understood that very soon we will write clone of ancestry which is obviously wrong. This means that methods deal with all_children should not be in acts_as_tree, we need to leave it simple. So I think that self_and_children is enough to satisfy any acts_as_tree user.
What do you think?
I agree with you, so I pulled the request, and just kept the self_and_children method.