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:
authorYorick Peterse <yorickpeterse@gmail.com>2018-04-05 14:19:24 +0300
committerSean McGivern <sean@gitlab.com>2018-04-09 13:58:06 +0300
commit20fdbbe86a6cffbf467f08d50a0d8ef0f5c87f50 (patch)
tree771a649785183c6d355483538a69a66824ad320c /app/models/concerns/resolvable_discussion.rb
parent63ab7c0f009001b99f6e7d7a7f21dadde1e6b969 (diff)
Use Goldiloader for handling N+1 queries
Goldiloader (https://github.com/salsify/goldiloader) can eager load associations automatically. This removes the need for adding "includes" calls in a variety of different places. This also comes with the added benefit of not having to eager load data if it's not used.
Diffstat (limited to 'app/models/concerns/resolvable_discussion.rb')
-rw-r--r--app/models/concerns/resolvable_discussion.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/concerns/resolvable_discussion.rb b/app/models/concerns/resolvable_discussion.rb
index 7c236369793..399abb67c9d 100644
--- a/app/models/concerns/resolvable_discussion.rb
+++ b/app/models/concerns/resolvable_discussion.rb
@@ -102,7 +102,7 @@ module ResolvableDiscussion
yield(notes_relation)
# Set the notes array to the updated notes
- @notes = notes_relation.fresh.to_a # rubocop:disable Gitlab/ModuleWithInstanceVariables
+ @notes = notes_relation.fresh.auto_include(false).to_a # rubocop:disable Gitlab/ModuleWithInstanceVariables
self.class.memoized_values.each do |name|
clear_memoization(name)