Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
f08f921d
Commit
f08f921d
authored
Dec 03, 2015
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support emoji awards also in merge requests
parent
2b577551
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
app/models/note.rb
app/models/note.rb
+4
-3
No files found.
app/models/note.rb
View file @
f08f921d
...
@@ -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?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment