Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2016-08-16 19:55:02 +0300
committerAhmad Sherif <me@ahmadsherif.com>2016-08-18 18:46:24 +0300
commit30654fc9c1afc222ebae5c5367657bd8f6e615b2 (patch)
treebcf07e2723405510a369071b6cf4ac4ee1be4895 /app/controllers/dashboard/todos_controller.rb
parent1f14495124e38a0682476744b95a8299ad06593a (diff)
Simplify SQL queries of marking a todo as done
Diffstat (limited to 'app/controllers/dashboard/todos_controller.rb')
-rw-r--r--app/controllers/dashboard/todos_controller.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/controllers/dashboard/todos_controller.rb b/app/controllers/dashboard/todos_controller.rb
index 1243bb96d4d..1f8cf1d91b0 100644
--- a/app/controllers/dashboard/todos_controller.rb
+++ b/app/controllers/dashboard/todos_controller.rb
@@ -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