Commit 173b1128 authored by James Lopez's avatar James Lopez Committed by James Lopez

Fix namespace helper - use pluck instead of slower map version.

parent 0c65112d
...@@ -31,7 +31,7 @@ module NamespacesHelper ...@@ -31,7 +31,7 @@ module NamespacesHelper
def process_extra_groups(extra_groups) def process_extra_groups(extra_groups)
# Remove duplicate groups - we either keep the ones that exist for the user # 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. # (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 = extra_groups - duplicated_groups.flatten
extra_groups.map { |name| Group.new(name: name) } extra_groups.map { |name| Group.new(name: name) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment