summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-03 12:46:39 +0100
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-03 13:39:00 +0100
commitf08f921d537c68ec0bbfb8a1ae7e905cded1bbad (patch)
treef170686bd24a9f6663fa579b736131d95e6dcff6
parent2b577551177c631d229eca6844520e29478085f8 (diff)
downloadgitlab-ce-f08f921d537c68ec0bbfb8a1ae7e905cded1bbad.tar.gz
Support emoji awards also in merge requests
-rw-r--r--app/models/note.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 8acb2cf7582..30d15d93fed 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -361,7 +361,7 @@ class Note < ActiveRecord::Base
# Method is executed as a before_validation callback.
#
def set_award!
- return unless issue_comment? && contains_emoji_only?
+ return unless supports_awards? && contains_emoji_only?
self.is_award = true
self.note = award_emoji_name
@@ -369,8 +369,9 @@ class Note < ActiveRecord::Base
private
- def issue_comment?
- noteable.kind_of?(Issue)
+ def supports_awards?
+ noteable.kind_of?(Issue) ||
+ noteable.is_a?(MergeRequest)
end
def contains_emoji_only?