Ray's changes
This commit is contained in:
1 parent
8d70d87120
commit
9ead6cafda
10 files changed
+403
-72
No files matched your search
@@ -31,6 +31,17 @@ class Item
|
||||
nodes << node = node.parent while !node.parent.blank? rescue nil
|
||||
nodes.reverse
|
||||
end
|
||||
|
||||
# Get an array of ancestor's id
|
||||
def ancestor_ids
|
||||
node, nodes = self, []
|
||||
while !node.parent.blank? do
|
||||
node = node.parent rescue nil
|
||||
nodes << node.id if node
|
||||
end
|
||||
# nodes << node = node.parent while !node.parent.blank? rescue nil
|
||||
nodes.reverse
|
||||
end
|
||||
|
||||
# Build the url from the array of ancestors
|
||||
def url
|
||||
|
||||
Reference in new issue
Block a user