Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-07 13:00:03 +0300
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-07 13:00:03 +0300
commit893d08c0dc6a1eba14db7694636707f30b28a7f4 (patch)
treebb96bf01db95ee65e31fdffe0e868b2c861b1de5
parentbfe91b692a89f7a5ee8a0b044fabf5ec397b2904 (diff)
Simplify `contains_emoji_only?` method in `Note`
-rw-r--r--app/models/note.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 2bee19479c5..239a0f77f8e 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -372,8 +372,7 @@ class Note < ActiveRecord::Base
end
def contains_emoji_only?
- emoji_only_pattern = /\A#{Gitlab::Markdown::EmojiFilter.emoji_pattern}\s?\Z/
- (note =~ emoji_only_pattern) ? true : false
+ note =~ /\A#{Gitlab::Markdown::EmojiFilter.emoji_pattern}\s?\Z/
end
def award_emoji_name