summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-09-09 15:19:33 +0200
committerhukl <contact@smyck.org>2009-09-09 15:19:33 +0200
commitf7ce8c245fde3f6202103ae614b181c0ba44ed93 (patch)
tree4625c54b0dfb31bdc3e71480fb8936fa5a6c0ca5 /app/models
parentf3a8cd8d1e8dfafb987163d95208e0ff2ccbfbc2 (diff)
added editing of slugs and moving of nodes. to edit a slug or move a node you edit that node, make your changes and save. the slug and parent node changes get staged and are applied once that revision is published
Diffstat (limited to 'app/models')
-rw-r--r--app/models/node.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index a870a3a..057248e 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -87,6 +87,15 @@ class Node < ActiveRecord::Base
87 self.head = self.draft 87 self.head = self.draft
88 self.head.save! 88 self.head.save!
89 self.draft = nil 89 self.draft = nil
90
91 if staged_slug && (staged_slug != slug)
92 self.slug = staged_slug
93 end
94
95 if staged_parent_id && (staged_parent_id != parent_id)
96 self.parent_id = staged_parent_id
97 end
98
90 self.save! 99 self.save!
91 self.unlock! 100 self.unlock!
92 else 101 else