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

21 lines
476 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Notes
class UpdateService < BaseService
def execute(note)
return note unless note.editable?
2017-03-28 02:25:43 -04:00
old_mentioned_users = note.mentioned_users.to_a
2018-07-02 06:43:06 -04:00
note.update(params.merge(updated_by: current_user))
note.create_new_cross_references!(current_user)
if note.previous_changes.include?('note')
2017-03-28 02:25:43 -04:00
TodoService.new.update_note(note, current_user, old_mentioned_users)
end
note
end
end
end