summaryrefslogtreecommitdiff
path: root/app/models/diff_note.rb
diff options
context:
space:
mode:
authorMike Lewis <mlewis@gitlab.com>2019-03-07 15:59:00 +0000
committerMike Lewis <mlewis@gitlab.com>2019-03-07 15:59:00 +0000
commitdbd7309a16bd3abc6c586b6c2df2beb317cfef95 (patch)
tree3fdd719c926ac80285f0dc93ef975625657d0fbb /app/models/diff_note.rb
parent7be248334b350091e83d0335bf0c263071c6a67f (diff)
parentb63efb09a5c864047924cd2d84527b47dd563d5f (diff)
downloadgitlab-ce-reply-to-comment-documentation.tar.gz
Merge branch 'master' into 'reply-to-comment-documentation'reply-to-comment-documentation
# Conflicts: # doc/user/discussions/index.md
Diffstat (limited to 'app/models/diff_note.rb')
-rw-r--r--app/models/diff_note.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb
index 279603496b0..805092e527a 100644
--- a/app/models/diff_note.rb
+++ b/app/models/diff_note.rb
@@ -41,6 +41,14 @@ class DiffNote < Note
create_note_diff_file(creation_params)
end
+ # Returns the diff file from `position`
+ def latest_diff_file
+ strong_memoize(:latest_diff_file) do
+ position.diff_file(project.repository)
+ end
+ end
+
+ # Returns the diff file from `original_position`
def diff_file
strong_memoize(:diff_file) do
enqueue_diff_file_creation_job if should_create_diff_file?