diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-11-21 19:32:59 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-11-21 20:17:06 +0300 |
commit | fbac9e106dd6acf35ba679b106b438a3bbfd191f (patch) | |
tree | 46900a8312f0079ac6776947a625c5495a5280a5 | |
parent | e2d5f9a83a5150a82144036aea1224377cfae921 (diff) |
Award: merge request fix
-rw-r--r-- | app/controllers/projects/notes_controller.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb index 1e3f1d8fd2f..ead940aea6c 100644 --- a/app/controllers/projects/notes_controller.rb +++ b/app/controllers/projects/notes_controller.rb @@ -59,8 +59,11 @@ class Projects::NotesController < Projects::ApplicationController end def award_toggle - noteable = note_params[:noteable_type] == "issue" ? Issue : MergeRequest - noteable = noteable.find_by!(id: note_params[:noteable_id], project: project) + noteable = if note_params[:noteable_type] == "issue" + project.issues.find(note_params[:noteable_id]) + else + project.merge_requests.find(note_params[:noteable_id]) + end data = { author: current_user, |