Simplify SQL queries of marking a todo as done

This commit is contained in:
Ahmad Sherif 2016-08-16 18:55:02 +02:00
parent 1f14495124
commit 30654fc9c1
2 changed files with 3 additions and 4 deletions

View File

@ -131,6 +131,7 @@ v 8.11.0 (unreleased)
- 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
- Update gitlab_git gem to 10.4.7
- Simplify SQL queries of marking a todo as done
v 8.10.6
- Upgrade Rails to 4.2.7.1 for security fixes. !5781

View File

@ -6,6 +6,8 @@ class Dashboard::TodosController < Dashboard::ApplicationController
end
def destroy
todo = Todo.new(id: params[:id])
TodoService.new.mark_todos_as_done([todo], current_user)
respond_to do |format|
@ -27,10 +29,6 @@ class Dashboard::TodosController < Dashboard::ApplicationController
private
def todo
@todo ||= find_todos.find(params[:id])
end
def find_todos
@todos ||= TodosFinder.new(current_user, params).execute
end