gitlab-org--gitlab-foss/app/services/notes/create_service.rb
dixpac e21492b810 Fix not normalized emoji paths
* There where path where +1 was stored as +1 not as thumbsup
  that was causing problems such as showing thumbsup icon 2 time.
  I fixed this to always normalize and store +1 as tumbsup
2016-07-14 08:51:00 +02:00

23 lines
600 B
Ruby

module Notes
class CreateService < BaseService
def execute
note = project.notes.new(params)
note.author = current_user
note.system = false
if note.award_emoji?
noteable = note.noteable
todo_service.new_award_emoji(noteable, current_user)
return noteable.create_award_emoji(note.award_emoji_name, current_user)
end
if note.save
# Finish the harder work in the background
NewNoteWorker.perform_in(2.seconds, note.id, params)
TodoService.new.new_note(note, current_user)
end
note
end
end
end