summaryrefslogtreecommitdiff
path: root/app/models/node.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/node.rb')
-rw-r--r--app/models/node.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index a1d8af0..e08e228 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -33,6 +33,11 @@ class Node < ActiveRecord::Base
33 33
34 # Instance Methods 34 # Instance Methods
35 35
36 # returns an array with all parts of a unique_name rather than a string
37 def unique_path
38 unique_name.split("/") rescue unique_name
39 end
40
36 # returns array with pages up to root excluding root 41 # returns array with pages up to root excluding root
37 def path_to_root 42 def path_to_root
38 parent.nil? && [slug] || parent.path_to_root.push(slug) 43 parent.nil? && [slug] || parent.path_to_root.push(slug)