Commit 30654fc9 authored by Ahmad Sherif's avatar Ahmad Sherif

Simplify SQL queries of marking a todo as done

parent 1f144951
...@@ -131,6 +131,7 @@ v 8.11.0 (unreleased) ...@@ -131,6 +131,7 @@ v 8.11.0 (unreleased)
- Ensure file editing in UI does not overwrite commited changes without warning user - Ensure file editing in UI does not overwrite commited changes without warning user
- Eliminate unneeded calls to Repository#blob_at when listing commits with no path - Eliminate unneeded calls to Repository#blob_at when listing commits with no path
- Update gitlab_git gem to 10.4.7 - Update gitlab_git gem to 10.4.7
- Simplify SQL queries of marking a todo as done
v 8.10.6 v 8.10.6
- Upgrade Rails to 4.2.7.1 for security fixes. !5781 - Upgrade Rails to 4.2.7.1 for security fixes. !5781
......
...@@ -6,6 +6,8 @@ class Dashboard::TodosController < Dashboard::ApplicationController ...@@ -6,6 +6,8 @@ class Dashboard::TodosController < Dashboard::ApplicationController
end end
def destroy def destroy
todo = Todo.new(id: params[:id])
TodoService.new.mark_todos_as_done([todo], current_user) TodoService.new.mark_todos_as_done([todo], current_user)
respond_to do |format| respond_to do |format|
...@@ -27,10 +29,6 @@ class Dashboard::TodosController < Dashboard::ApplicationController ...@@ -27,10 +29,6 @@ class Dashboard::TodosController < Dashboard::ApplicationController
private private
def todo
@todo ||= find_todos.find(params[:id])
end
def find_todos def find_todos
@todos ||= TodosFinder.new(current_user, params).execute @todos ||= TodosFinder.new(current_user, params).execute
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment