Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-02-13 14:43:26 +0300
committerSean McGivern <sean@mcgivern.me.uk>2017-02-13 14:43:26 +0300
commit7d4d9365c0d9025d5c08ec503be304b4d3f63997 (patch)
tree4373f47e3a71451f52cdf10757fefaaea0d34c30 /app/models/concerns
parent6a1b3ef73f57d58d159e343f79e1f74418c2f763 (diff)
parent0b14b654b6e5d936f7241dcc0c249e0d4cc42728 (diff)
Merge branch 'issue_25900_2' into 'master'
Gather issuable metadata to avoid n+ queries on index view Closes #25900 See merge request !9006
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/issuable.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb
index d1872dd931d..5f53c48fc88 100644
--- a/app/models/concerns/issuable.rb
+++ b/app/models/concerns/issuable.rb
@@ -15,6 +15,11 @@ module Issuable
include Taskable
include TimeTrackable
+ # This object is used to gather issuable meta data for displaying
+ # upvotes, downvotes and notes count for issues and merge requests
+ # lists avoiding n+1 queries and improving performance.
+ IssuableMeta = Struct.new(:upvotes, :downvotes, :notes_count)
+
included do
cache_markdown_field :title, pipeline: :single_line
cache_markdown_field :description