Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-07-30 15:45:54 +0300
committerDouwe Maan <douwe@gitlab.com>2015-07-30 15:45:54 +0300
commit36bd6c8494d4d1deb09f749a02aa9981c8d3080f (patch)
tree697f887f318c60bc8731173d7bc2ecdfdc7349e4 /app/services/notes/update_service.rb
parenta06827bff934a7b387dc4280a555e0c81cc06604 (diff)
Show who last edited a comment if it wasn't the original author
Diffstat (limited to 'app/services/notes/update_service.rb')
-rw-r--r--app/services/notes/update_service.rb19
1 files changed, 4 insertions, 15 deletions
diff --git a/app/services/notes/update_service.rb b/app/services/notes/update_service.rb
index b5611d46257..897716cf6a5 100644
--- a/app/services/notes/update_service.rb
+++ b/app/services/notes/update_service.rb
@@ -1,22 +1,11 @@
module Notes
class UpdateService < BaseService
- def execute
- note = project.notes.find(params[:note_id])
- note.note = params[:note]
- if note.save
- notification_service.new_note(note)
+ def execute(note)
+ return note unless note.editable?
- # Skip system notes, like status changes and cross-references.
- unless note.system
- event_service.leave_note(note, note.author)
+ note.update_attributes(params.merge(updated_by: current_user))
- # Create a cross-reference note if this Note contains GFM that
- # names an issue, merge request, or commit.
- note.references.each do |mentioned|
- SystemNoteService.cross_reference(mentioned, note.noteable, note.author)
- end
- end
- end
+ project.reset_events_cache
note
end