diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-09 15:08:59 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-09 15:08:59 +0000 |
commit | 6f2b1c32f3ccf422575f591b42372534502dcd72 (patch) | |
tree | 2ed532687d73e290f07c760825c02a2ecbaa5416 /app/services/notes | |
parent | b90d8b54a4d623e52cf1d4318023e3b18d13dd5b (diff) | |
download | gitlab-ce-6f2b1c32f3ccf422575f591b42372534502dcd72.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/notes')
-rw-r--r-- | app/services/notes/update_service.rb | 16 |
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) |