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:
Diffstat (limited to 'app/services/notes/update_service.rb')
-rw-r--r--app/services/notes/update_service.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/app/services/notes/update_service.rb b/app/services/notes/update_service.rb
index 857ffbb6965..76f9b6369b3 100644
--- a/app/services/notes/update_service.rb
+++ b/app/services/notes/update_service.rb
@@ -7,12 +7,7 @@ module Notes
old_mentioned_users = note.mentioned_users(current_user).to_a
- note.assign_attributes(params.merge(updated_by: current_user))
-
- note.with_transaction_returning_status do
- update_confidentiality(note)
- note.save
- end
+ note.assign_attributes(params)
track_note_edit_usage_for_issues(note) if note.for_issue?
track_note_edit_usage_for_merge_requests(note) if note.for_merge_request?
@@ -28,6 +23,15 @@ module Notes
note.note = content
end
+ if note.note_changed?
+ note.assign_attributes(last_edited_at: Time.current, updated_by: current_user)
+ end
+
+ note.with_transaction_returning_status do
+ update_confidentiality(note)
+ note.save
+ end
+
unless only_commands || note.for_personal_snippet?
note.create_new_cross_references!(current_user)