0
@@ -377,6 +377,17 @@ class TodosController < ApplicationController
0
+ v.each_with_index do |id, position|
0
+ current_user.todos.update(id, :position => position + 1)
0
+ render :nothing => true
0
def get_todo_from_params
0
@@ -490,7 +501,7 @@ class TodosController < ApplicationController
0
@not_done_todos = Todo.find(:all,
0
:conditions => ['todos.user_id = ? AND contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)',
0
current_user.id, false, 'active'],
0
- :order => "todos.
due IS NULL, todos.due ASC, todos.created_at ASC",
0
+ :order => "todos.
position, todos.due IS NULL, todos.due ASC, todos.created_at ASC",
0
:include => [ :project, :context, :tags ])
0
@@ -507,7 +518,7 @@ class TodosController < ApplicationController
0
@not_done_todos = Todo.find(:all,
0
:conditions => ['todos.user_id = ? AND todos.state = ? AND contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)',
0
current_user.id, 'active', false, 'active'],
0
- :order => "todo
s.due IS NULL, todos.due ASC, todos.created_at ASC",
0
+ :order => "todo
.position, todos.due IS NULL, todos.due ASC, todos.created_at ASC",
0
:include => [ :project, :context, :tags ])
Comments
No one has commented yet.