diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2015-12-07 15:26:56 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2015-12-07 15:26:56 +0300 |
commit | 359d94607c2df324bc5cd9591bded05dbe9ca157 (patch) | |
tree | 1ab19b405514e2e980bb241dd379bb1a981b8932 /app/services/notes/create_service.rb | |
parent | 104df74f512dd7174a49504dda0b0910ee43b787 (diff) | |
parent | 893d08c0dc6a1eba14db7694636707f30b28a7f4 (diff) |
Merge branch 'fix/award-emoji-conflict-in-notes' into 'master'
Fix problems with award-emoji-only comment
This fixes a conflict between note with only a single emoji in content
and award-emojis mechanisms.
Closes #3734
cc @vsizov
See merge request !1936
Diffstat (limited to 'app/services/notes/create_service.rb')
-rw-r--r-- | app/services/notes/create_service.rb | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index dbff58dfb9c..a8486e6a5a1 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -5,11 +5,6 @@ module Notes note.author = current_user note.system = false - if contains_emoji_only?(params[:note]) - note.is_award = true - note.note = emoji_name(params[:note]) - end - if note.save notification_service.new_note(note) @@ -33,13 +28,5 @@ module Notes note.project.execute_hooks(note_data, :note_hooks) note.project.execute_services(note_data, :note_hooks) end - - def contains_emoji_only?(note) - note =~ /\A:[-_+[:alnum:]]*:\s?\z/ - end - - def emoji_name(note) - note.match(/\A:([-_+[:alnum:]]*):\s?/)[1] - end end end |