summaryrefslogtreecommitdiff
path: root/app/services/notes/create_service.rb
blob: 8d9661167b522483ea89eb75f16010243fcfdb27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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