diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-18 03:14:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-18 03:14:00 +0300 |
commit | e1d036885e2f5720e847d9009f60c5d7baad0015 (patch) | |
tree | 2fd1a36b792ff2e7d71944d28cb1473dfe22cde4 /app/models/concerns/issuable.rb | |
parent | 6bdb805dc87064d97d303ce8864f30e48663c6e9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/issuable.rb')
-rw-r--r-- | app/models/concerns/issuable.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 1f05aa0954d..dcd80201d3f 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -66,6 +66,11 @@ module Issuable # We check first if we're loaded to not load unnecessarily. loaded? && to_a.all? { |note| note.association(:project).loaded? } end + + def system_note_metadata_loaded? + # We check first if we're loaded to not load unnecessarily. + loaded? && to_a.all? { |note| note.association(:system_note_metadata).loaded? } + end end has_many :note_authors, -> { distinct }, through: :notes, source: :author @@ -534,6 +539,7 @@ module Issuable includes << :author unless notes.authors_loaded? includes << :award_emoji unless notes.award_emojis_loaded? includes << :project unless notes.projects_loaded? + includes << :system_note_metadata unless notes.system_note_metadata_loaded? if includes.any? notes.includes(includes) |