Extract counters from accounts table to account_stats table (#9295)
This commit is contained in:
parent
4fdefffb99
commit
d6b9a62e0a
25 changed files with 203 additions and 68 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue