diff options
| author | hukl <hukl@eight.local> | 2009-01-31 13:05:48 +0100 |
|---|---|---|
| committer | hukl <hukl@eight.local> | 2009-01-31 13:05:48 +0100 |
| commit | 5b06d137fc6143ff679d1ce6048c4149ca23f4e2 (patch) | |
| tree | c2945a13eb3376aabb0d610804bf7a8f972793e7 /app | |
| parent | be83d467b5b6f92b0a6a175ee365d043f250d631 (diff) | |
connected page and node model + some minor tweaks
Diffstat (limited to 'app')
| -rw-r--r-- | app/models/node.rb | 2 |
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 @@ | |||
| 1 | class Node < ActiveRecord::Base | 1 | class 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) |
