diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-05-30 14:50:09 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-05-30 14:50:09 +0900 |
commit | 09122f93c34b15cb827aabdbdf35fc33b08f93af (patch) | |
tree | 57c137ef57621a7a2ed4940c56c7f5cbe6ec1c80 /app/models/note.rb | |
parent | 1d20679e9c8b1ba16bebaf982255946e7207b4d4 (diff) | |
parent | 5b1416aa74c4fa80e0c324fd2907166af5ca479b (diff) | |
download | gitlab-ce-09122f93c34b15cb827aabdbdf35fc33b08f93af.tar.gz |
Merge branch 'master' into per-project-pipeline-iid
Diffstat (limited to 'app/models/note.rb')
-rw-r--r-- | app/models/note.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index 109405d3f17..02f7a9b1e4f 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -63,6 +63,7 @@ class Note < ActiveRecord::Base has_many :todos has_many :events, as: :target, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_one :system_note_metadata + has_one :note_diff_file, inverse_of: :diff_note, foreign_key: :diff_note_id delegate :gfm_reference, :local_reference, to: :noteable delegate :name, to: :project, prefix: true @@ -100,7 +101,8 @@ class Note < ActiveRecord::Base scope :inc_author_project, -> { includes(:project, :author) } scope :inc_author, -> { includes(:author) } scope :inc_relations_for_view, -> do - includes(:project, :author, :updated_by, :resolved_by, :award_emoji, :system_note_metadata) + includes(:project, :author, :updated_by, :resolved_by, :award_emoji, + :system_note_metadata, :note_diff_file) end scope :diff_notes, -> { where(type: %w(LegacyDiffNote DiffNote)) } |