Convert to project did not use current_user so new projects were always linked to the user with id 1.

This commit is contained in:
Reinier Balt 2010-02-05 09:51:50 +01:00
parent c9566047fc
commit dc811c8fc7

View file

@ -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!