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.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index 9bfea52..7e64fdd 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -165,6 +165,14 @@ class Node < ActiveRecord::Base
165 head_id 165 head_id
166 end 166 end
167 167
168 # 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.
170 # Can be removed after a year or so ;)
171 def feed_id
172 new_id_format_date = "2009-11-14".to_time
173 self.created_at < new_id_format_date ? unique_path : id
174 end
175
168 protected 176 protected
169 def lock_for! current_user 177 def lock_for! current_user
170 self.lock_owner = current_user 178 self.lock_owner = current_user