summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorJames Lopez <james@gitlab.com>2016-09-09 14:47:38 +0000
committerJames Lopez <james@jameslopez.es>2016-09-20 10:14:39 +0200
commit173b1128ff485d6614b8a785796d575d4d84dd68 (patch)
tree0a5990c2bf4c7115c0eda2ffdf0656420dd53b95 /app/helpers
parent0c65112da79e177da3574458c3bb5befc349fd30 (diff)
downloadgitlab-ce-173b1128ff485d6614b8a785796d575d4d84dd68.tar.gz
Fix namespace helper - use pluck instead of slower map version.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/namespaces_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb
index af06833ef91..4641076d22c 100644
--- a/app/helpers/namespaces_helper.rb
+++ b/app/helpers/namespaces_helper.rb
@@ -31,7 +31,7 @@ module NamespacesHelper
def process_extra_groups(extra_groups)
# Remove duplicate groups - we either keep the ones that exist for the user
# (already in groups) or ignore those that do not belong to the user.
- duplicated_groups = extra_groups.map { |name| Namespace.where(name: name).map(&:name) }
+ duplicated_groups = extra_groups.map { |name| Namespace.where(name: name).pluck(:name) }
extra_groups = extra_groups - duplicated_groups.flatten
extra_groups.map { |name| Group.new(name: name) }