Commit f08f921d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Support emoji awards also in merge requests

parent 2b577551
...@@ -361,7 +361,7 @@ class Note < ActiveRecord::Base ...@@ -361,7 +361,7 @@ class Note < ActiveRecord::Base
# Method is executed as a before_validation callback. # Method is executed as a before_validation callback.
# #
def set_award! def set_award!
return unless issue_comment? && contains_emoji_only? return unless supports_awards? && contains_emoji_only?
self.is_award = true self.is_award = true
self.note = award_emoji_name self.note = award_emoji_name
...@@ -369,8 +369,9 @@ class Note < ActiveRecord::Base ...@@ -369,8 +369,9 @@ class Note < ActiveRecord::Base
private private
def issue_comment? def supports_awards?
noteable.kind_of?(Issue) noteable.kind_of?(Issue) ||
noteable.is_a?(MergeRequest)
end end
def contains_emoji_only? def contains_emoji_only?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment