diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-11-16 15:02:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 15:02:18 +0100 |
commit | 8069fd636ba14059524303ce76abe2173c4f3d01 (patch) | |
tree | 55dd4f8ecd39813080cb5ddedd834f93a7ffc919 /app/models/notification.rb | |
parent | 367ad2199509e9008c04c08f3476e236b27b52a1 (diff) |
Remove intermediary arrays when creating hash maps from results (#9291)
Diffstat (limited to 'app/models/notification.rb')
-rw-r--r-- | app/models/notification.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/notification.rb b/app/models/notification.rb index 78b180301..4233532d0 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -75,7 +75,7 @@ class Notification < ApplicationRecord return if account_ids.empty? - accounts = Account.where(id: account_ids).map { |a| [a.id, a] }.to_h + accounts = Account.where(id: account_ids).each_with_object({}) { |a, h| h[a.id] = a } cached_items.each do |item| item.from_account = accounts[item.from_account_id] |