mirror of
https://github.com/redmine/redmine.git
synced 2025-11-12 16:26:03 +01:00
Adds child_pages macro for wiki pages (#528).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1699 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -70,6 +70,13 @@ module ActiveRecord
|
||||
nodes
|
||||
end
|
||||
|
||||
# Returns list of descendants.
|
||||
#
|
||||
# root.descendants # => [child1, subchild1, subchild2]
|
||||
def descendants
|
||||
children + children.collect(&:children).flatten
|
||||
end
|
||||
|
||||
# Returns the root node of the tree.
|
||||
def root
|
||||
node = self
|
||||
|
||||
Reference in New Issue
Block a user