summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-03-15 09:44:57 +0000
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-03-19 13:56:29 +0000
commit11e8798402bffe626c21540fde09571034720907 (patch)
tree2814629f41698c1bc1483f1384014743ebb309e2 /app
parent14a681fd99893cdc62dfd91a00960edd3eb7cc28 (diff)
downloadgitlab-ce-11e8798402bffe626c21540fde09571034720907.tar.gz
Merge branch '57330-fix-comment-edited' into 'master'
Hide "Edited" when note is transformed or resolved Closes #57330 See merge request gitlab-org/gitlab-ce!26143 (cherry picked from commit 6461cbdfa4df0873d62183ca0c0979b20040fde6) f5f243a0 Hide "Edited" when note is transformed or resolved
Diffstat (limited to 'app')
-rw-r--r--app/models/note.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 1578ae9c4cc..2c9980b1a0d 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -313,6 +313,14 @@ class Note < ActiveRecord::Base
!system?
end
+ # Since we're using `updated_at` as `last_edited_at`, it could be touched by transforming / resolving a note.
+ # This makes sure it is only marked as edited when the note body is updated.
+ def edited?
+ return false if updated_by.blank?
+
+ super
+ end
+
def cross_reference_not_visible_for?(user)
cross_reference? && !all_referenced_mentionables_allowed?(user)
end