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:
authorDouwe Maan <douwe@selenight.nl>2016-08-17 20:14:44 +0300
committerDouwe Maan <douwe@selenight.nl>2016-08-17 20:16:46 +0300
commit4a13aa9f34ab4114bc485e1ca8fa0db8daa0394b (patch)
tree17554a901009603f52be08914636495b06db2e68 /app/controllers/projects/discussions_controller.rb
parentf3acf9fd248a16665a114bf6cce761e9277c2d5b (diff)
Store discussion_id on Note for faster discussion lookup.
Diffstat (limited to 'app/controllers/projects/discussions_controller.rb')
-rw-r--r--app/controllers/projects/discussions_controller.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/controllers/projects/discussions_controller.rb b/app/controllers/projects/discussions_controller.rb
index 620b41b1011..b2e8733ccb7 100644
--- a/app/controllers/projects/discussions_controller.rb
+++ b/app/controllers/projects/discussions_controller.rb
@@ -5,8 +5,6 @@ class Projects::DiscussionsController < Projects::ApplicationController
before_action :authorize_resolve_discussion!
def resolve
- return render_404 unless discussion.resolvable?
-
discussion.resolve!(current_user)
MergeRequests::ResolvedDiscussionNotificationService.new(project, current_user).execute(merge_request)
@@ -18,8 +16,6 @@ class Projects::DiscussionsController < Projects::ApplicationController
end
def unresolve
- return render_404 unless discussion.resolvable?
-
discussion.unresolve!
render json: {
@@ -34,7 +30,7 @@ class Projects::DiscussionsController < Projects::ApplicationController
end
def discussion
- @discussion ||= @merge_request.find_discussion(params[:id]) || render_404
+ @discussion ||= @merge_request.find_diff_discussion(params[:id]) || render_404
end
def authorize_resolve_discussion!