2012-07-31 05:32:49 +00:00
|
|
|
module Notes
|
2014-01-16 17:03:42 +00:00
|
|
|
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
|
2014-02-20 12:07:42 +00:00
|
|
|
note.system = false
|
2014-06-17 19:09:01 +00:00
|
|
|
|
|
|
|
if note.save
|
2016-01-27 15:59:16 +00:00
|
|
|
# Finish the harder work in the background
|
|
|
|
NewNoteWorker.perform_in(2.seconds, note.id, params)
|
2014-06-17 19:09:01 +00:00
|
|
|
end
|
|
|
|
|
2012-07-31 05:32:49 +00:00
|
|
|
note
|
|
|
|
end
|
2015-03-05 18:38:23 +00:00
|
|
|
|
2012-07-31 05:32:49 +00:00
|
|
|
end
|
|
|
|
end
|