From 06ec666fa8fad0aafe7d8e505f6e92b729fccbce Mon Sep 17 00:00:00 2001 From: hukl Date: Sun, 22 Mar 2009 17:14:08 +0100 Subject: 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! --- app/controllers/nodes_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'app/controllers/nodes_controller.rb') 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 def unlock # TODO that actually has to be implemented in the model, once we have # permissions - if draft = @node.draft - draft.user = nil - draft.save + if @node.user + @node.unlock! flash[:notice] = "Node unlocked" else flash[:notice] = "Cannot unlock" -- cgit v1.3