diff options
author | James Lopez <james@gitlab.com> | 2016-09-09 14:47:38 +0000 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-09-20 10:14:39 +0200 |
commit | 173b1128ff485d6614b8a785796d575d4d84dd68 (patch) | |
tree | 0a5990c2bf4c7115c0eda2ffdf0656420dd53b95 /app/helpers/namespaces_helper.rb | |
parent | 0c65112da79e177da3574458c3bb5befc349fd30 (diff) | |
download | gitlab-ce-173b1128ff485d6614b8a785796d575d4d84dd68.tar.gz |
Fix namespace helper - use pluck instead of slower map version.
Diffstat (limited to 'app/helpers/namespaces_helper.rb')
-rw-r--r-- | app/helpers/namespaces_helper.rb | 2 |
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) } |