From dc811c8fc7bbfcb1f3a9185d7dc15ebd99e69d35 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Fri, 5 Feb 2010 09:51:50 +0100 Subject: [PATCH] Convert to project did not use current_user so new projects were always linked to the user with id 1. --- app/controllers/todos_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index fc928a03..2e75cabf 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -640,8 +640,8 @@ class TodosController < ApplicationController end def convert_to_project - @todo = Todo.find(params[:id]) - @project = Project.new(:name => @todo.description, :description => @todo.notes, + @todo = current_user.todos.find(params[:id]) + @project = current_user.projects.new(:name => @todo.description, :description => @todo.notes, :default_context => @todo.context) @todo.destroy @project.save!