gitlab-org--gitlab-foss/app/services/notes/create_service.rb

18 lines
388 B
Ruby
Raw Normal View History

2012-07-31 05:32:49 +00:00
module Notes
class CreateService < BaseService
2012-07-31 05:32:49 +00:00
def execute
2014-06-17 19:09:01 +00:00
note = project.notes.new(params)
2012-07-31 05:32:49 +00:00
note.author = current_user
note.system = false
2014-06-17 19:09:01 +00:00
if note.save
# Finish the harder work in the background
NewNoteWorker.perform_in(2.seconds, note.id, params)
2016-02-20 13:59:59 +00:00
TodoService.new.new_note(note, current_user)
2014-06-17 19:09:01 +00:00
end
2012-07-31 05:32:49 +00:00
note
end
end
end