diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-07-28 16:57:42 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-28 16:57:42 -0600 |
commit | ce1843b7dea3b63cfced7800612098a766c68e13 (patch) | |
tree | 3340c4b5aca30047c2e22986c15f355bf3f845fe /app/models/legacy_diff_note.rb | |
parent | 8b1a2e4d0b635c6040cd7e4a7a5870ffae516cb0 (diff) | |
parent | b9b0c0283a001010370741c2683e2fe400bf7599 (diff) | |
download | gitlab-ce-ce1843b7dea3b63cfced7800612098a766c68e13.tar.gz |
Merge branch 'master' into diff-line-comment-vuejs
# Conflicts:
# db/schema.rb
Diffstat (limited to 'app/models/legacy_diff_note.rb')
-rw-r--r-- | app/models/legacy_diff_note.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/legacy_diff_note.rb b/app/models/legacy_diff_note.rb index 7bff9f4f052..bbb9f2346eb 100644 --- a/app/models/legacy_diff_note.rb +++ b/app/models/legacy_diff_note.rb @@ -25,6 +25,14 @@ class LegacyDiffNote < Note @discussion_id ||= Digest::SHA1.hexdigest(self.class.build_discussion_id(noteable_type, noteable_id || commit_id, line_code)) end + def project_repository + if RequestStore.active? + RequestStore.fetch("project:#{project_id}:repository") { self.project.repository } + else + self.project.repository + end + end + def diff_file_hash line_code.split('_')[0] if line_code end @@ -34,7 +42,7 @@ class LegacyDiffNote < Note end def diff_file - @diff_file ||= Gitlab::Diff::File.new(diff, repository: self.project.repository) if diff + @diff_file ||= Gitlab::Diff::File.new(diff, repository: project_repository) if diff end def diff_line |