summaryrefslogtreecommitdiff
path: root/lib/api/merge_requests.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-10 17:56:35 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-10 17:56:35 +0300
commitf8ea52c3a0fe29daf76fbd7a0e65399c09c95f5a (patch)
tree6f1df03a8ca996cce004a28c57f6e1e88ed72f7b /lib/api/merge_requests.rb
parenta7be3dfa30a452b307d1fdc0b4157ecbe908da8d (diff)
downloadgitlab-ce-f8ea52c3a0fe29daf76fbd7a0e65399c09c95f5a.tar.gz
Remove thread vars usage from API notes and mr's
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/api/merge_requests.rb')
-rw-r--r--lib/api/merge_requests.rb19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index 017cb1f562e..fc1f1254a9e 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -184,21 +184,18 @@ module API
# POST /projects/:id/merge_request/:merge_request_id/comments
#
post ":id/merge_request/:merge_request_id/comments" do
- set_current_user_for_thread do
- required_attributes! [:note]
+ required_attributes! [:note]
- merge_request = user_project.merge_requests.find(params[:merge_request_id])
- note = merge_request.notes.new(note: params[:note], project_id: user_project.id)
- note.author = current_user
+ merge_request = user_project.merge_requests.find(params[:merge_request_id])
+ note = merge_request.notes.new(note: params[:note], project_id: user_project.id)
+ note.author = current_user
- if note.save
- present note, with: Entities::MRNote
- else
- not_found!
- end
+ if note.save
+ present note, with: Entities::MRNote
+ else
+ not_found!
end
end
-
end
end
end