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.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index e2ff973..cac4495 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -1,6 +1,8 @@
1class Node < ActiveRecord::Base 1class Node < ActiveRecord::Base
2 acts_as_nested_set 2 acts_as_nested_set
3 3
4 has_many :pages
5
4 # returns array with pages up to root excluding root 6 # returns array with pages up to root excluding root
5 def path_to_root 7 def path_to_root
6 parent.nil? && [slug] || parent.path_to_root.push(slug) 8 parent.nil? && [slug] || parent.path_to_root.push(slug)