diff options
Diffstat (limited to 'app/models/node.rb')
| -rw-r--r-- | app/models/node.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/node.rb b/app/models/node.rb index 7e64fdd..e9d935a 100644 --- a/app/models/node.rb +++ b/app/models/node.rb | |||
| @@ -123,7 +123,7 @@ class Node < ActiveRecord::Base | |||
| 123 | 123 | ||
| 124 | # returns an array with all parts of a unique_name rather than a string | 124 | # returns an array with all parts of a unique_name rather than a string |
| 125 | def unique_path | 125 | def unique_path |
| 126 | unique_name.split("/") rescue unique_name | 126 | unique_name.split("/") rescue [unique_name] |
| 127 | end | 127 | end |
| 128 | 128 | ||
| 129 | # returns array with pages up to root excluding root | 129 | # returns array with pages up to root excluding root |
| @@ -165,6 +165,10 @@ class Node < ActiveRecord::Base | |||
| 165 | head_id | 165 | head_id |
| 166 | end | 166 | end |
| 167 | 167 | ||
| 168 | def update? | ||
| 169 | unique_path.length == 3 && unique_path[0] == "updates" | ||
| 170 | end | ||
| 171 | |||
| 168 | # Returns immutable node id for all new nodes so that the atom feed entry ids | 172 | # Returns immutable node id for all new nodes so that the atom feed entry ids |
| 169 | # stay the same eventhough the slug or positions changes. | 173 | # stay the same eventhough the slug or positions changes. |
| 170 | # Can be removed after a year or so ;) | 174 | # Can be removed after a year or so ;) |
