diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 13:37:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 13:37:47 +0000 |
commit | aee0a117a889461ce8ced6fcf73207fe017f1d99 (patch) | |
tree | 891d9ef189227a8445d83f35c1b0fc99573f4380 /app/models/concerns/issuable.rb | |
parent | 8d46af3258650d305f53b819eabf7ab18d22f59e (diff) | |
download | gitlab-ce-aee0a117a889461ce8ced6fcf73207fe017f1d99.tar.gz |
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'app/models/concerns/issuable.rb')
-rw-r--r-- | app/models/concerns/issuable.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 4273eb331a1..dcd80201d3f 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -43,7 +43,7 @@ module Issuable included do cache_markdown_field :title, pipeline: :single_line - cache_markdown_field :description, issuable_state_filter_enabled: true + cache_markdown_field :description, issuable_reference_expansion_enabled: true redact_field :description @@ -61,6 +61,16 @@ module Issuable # We check first if we're loaded to not load unnecessarily. loaded? && to_a.all? { |note| note.association(:award_emoji).loaded? } end + + def projects_loaded? + # 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 @@ -183,6 +193,10 @@ module Issuable incident? end + def supports_escalation? + incident? + end + def incident? is_a?(Issue) && super end @@ -524,6 +538,8 @@ module Issuable includes = [] 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) |