diff options
author | Nick Thomas <nick@gitlab.com> | 2019-03-25 14:29:51 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-05-06 11:35:03 +0100 |
commit | 8973f32d428ab8961986700700a2bad51fe7d4af (patch) | |
tree | c527841677c6f2a4b2823f0539331d511ad60730 /app/models/note_diff_file.rb | |
parent | d7eb886b9fd32ad2d0ab7bca9128dbb40e80c0da (diff) | |
download | gitlab-ce-8973f32d428ab8961986700700a2bad51fe7d4af.tar.gz |
Remove cleaned up OIDs from database and cache
Diffstat (limited to 'app/models/note_diff_file.rb')
-rw-r--r-- | app/models/note_diff_file.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/note_diff_file.rb b/app/models/note_diff_file.rb index 9afb94c869a..fcc9e2b3fd8 100644 --- a/app/models/note_diff_file.rb +++ b/app/models/note_diff_file.rb @@ -7,6 +7,10 @@ class NoteDiffFile < ApplicationRecord joins(:diff_note).where("resolved_at IS NULL OR noteable_type = 'Commit'") end + scope :referencing_sha, -> (oids, project_id:) do + joins(:diff_note).where(notes: { project_id: project_id, commit_id: oids }) + end + delegate :original_position, :project, to: :diff_note belongs_to :diff_note, inverse_of: :note_diff_file |