summaryrefslogtreecommitdiff
path: root/app/controllers/nodes_controller.rb
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-03-22 17:14:08 +0100
committerhukl <contact@smyck.org>2009-03-22 17:14:08 +0100
commit06ec666fa8fad0aafe7d8e505f6e92b729fccbce (patch)
tree8ae948c50ffd9ebcf264f1b02dcea150c6eb96e1 /app/controllers/nodes_controller.rb
parentc2f581ac675a869c2f0600c738332c0674a3606c (diff)
Finally! The cloning of pages for creating new drafts is now a lot cleaner. I had to search for a while to figure out a better way. Thank you svenfuchs and joshmh for the support!
Diffstat (limited to 'app/controllers/nodes_controller.rb')
-rw-r--r--app/controllers/nodes_controller.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb
index f773c6a..1796090 100644
--- a/app/controllers/nodes_controller.rb
+++ b/app/controllers/nodes_controller.rb
@@ -78,9 +78,8 @@ class NodesController < ApplicationController
78 def unlock 78 def unlock
79 # TODO that actually has to be implemented in the model, once we have 79 # TODO that actually has to be implemented in the model, once we have
80 # permissions 80 # permissions
81 if draft = @node.draft 81 if @node.user
82 draft.user = nil 82 @node.unlock!
83 draft.save
84 flash[:notice] = "Node unlocked" 83 flash[:notice] = "Node unlocked"
85 else 84 else
86 flash[:notice] = "Cannot unlock" 85 flash[:notice] = "Cannot unlock"