diff options
author | Robert Speicher <robert@gitlab.com> | 2015-11-21 21:58:47 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-11-21 21:58:47 +0300 |
commit | 78be7055e5c5ef5137257c795e494b78dd1d9245 (patch) | |
tree | 221ef7417d326ffe8484c21d70c3f680a07a352c | |
parent | c502695fdb9b01b4ff8721845e1d39f3d3369008 (diff) | |
parent | fbac9e106dd6acf35ba679b106b438a3bbfd191f (diff) |
Merge branch 'award_fix' into 'master'
Award Emoji: fix for merge requests
Closes #3597
See merge request !1865
-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, |