diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-28 21:09:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-28 21:09:27 +0300 |
commit | e1b9b92a49eea88ea7c3b101aec0315e64e94678 (patch) | |
tree | fadb5aa290045f6b345ad51b4752515d5a126dd7 /app/finders | |
parent | c6ee7ef0f577e0155740d022babdc1b2b0e28d87 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/autocomplete/users_finder.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/finders/autocomplete/users_finder.rb b/app/finders/autocomplete/users_finder.rb index 8dc3c2320ed..ff5d9ea7d19 100644 --- a/app/finders/autocomplete/users_finder.rb +++ b/app/finders/autocomplete/users_finder.rb @@ -38,7 +38,9 @@ module Autocomplete end end - items.uniq + items.uniq.tap do |unique_items| + preload_associations(unique_items) + end end private @@ -91,6 +93,12 @@ module Autocomplete User.none end end + + # rubocop: disable CodeReuse/ActiveRecord + def preload_associations(items) + ActiveRecord::Associations::Preloader.new.preload(items, :status) + end + # rubocop: enable CodeReuse/ActiveRecord end end |