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

18 lines
410 B
Ruby
Raw Normal View History

module Notes
class UpdateService < BaseService
def execute(note)
return note unless note.editable?
note.update_attributes(params.merge(updated_by: current_user))
note.create_new_cross_references!(current_user)
2015-07-31 08:29:18 -04:00
note.reset_events_cache
if note.previous_changes.include?('note')
2016-02-20 08:59:59 -05:00
TodoService.new.update_note(note, current_user)
end
note
end
end
end