summaryrefslogtreecommitdiff
path: root/lib/banzai/filter/user_reference_filter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/banzai/filter/user_reference_filter.rb')
-rw-r--r--lib/banzai/filter/user_reference_filter.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/banzai/filter/user_reference_filter.rb b/lib/banzai/filter/user_reference_filter.rb
index 849e1142841..fe1f0923136 100644
--- a/lib/banzai/filter/user_reference_filter.rb
+++ b/lib/banzai/filter/user_reference_filter.rb
@@ -74,10 +74,7 @@ module Banzai
# The keys of this Hash are the namespace paths, the values the
# corresponding Namespace objects.
def namespaces
- @namespaces ||=
- Namespace.where_full_path_in(usernames).each_with_object({}) do |row, hash|
- hash[row.full_path] = row
- end
+ @namespaces ||= Namespace.where_full_path_in(usernames).index_by(&:full_path)
end
# Returns all usernames referenced in the current document.