gitlab-org--gitlab-foss/app/services/notes/create_service.rb
2016-01-28 13:04:42 -05:00

17 lines
336 B
Ruby

module Notes
class CreateService < BaseService
def execute
note = project.notes.new(params)
note.author = current_user
note.system = false
if note.save
# Finish the harder work in the background
NewNoteWorker.perform_in(2.seconds, note.id, params)
end
note
end
end
end