diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-11-19 00:43:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-19 00:43:52 +0100 |
commit | d6b9a62e0a13497b8cc40eb1db56d1ec2b3760ea (patch) | |
tree | f8627888dd9dce43f66427261a90a3e9886b4df7 /app/models/notification.rb | |
parent | 4fdefffb9906ffc3e5fde7af652674bebffd6e15 (diff) |
Extract counters from accounts table to account_stats table (#9295)
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 4233532d0..2f0a9b78c 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).each_with_object({}) { |a, h| h[a.id] = a } + accounts = Account.where(id: account_ids).includes(:account_stat).each_with_object({}) { |a, h| h[a.id] = a } cached_items.each do |item| item.from_account = accounts[item.from_account_id] |