Add counter caches for a large performance increase on API requests
This commit is contained in:
@ -9,7 +9,7 @@ class Api::V1::FollowRequestsController < ApiController
|
||||
accounts = Account.where(id: results.map(&:account_id)).map { |a| [a.id, a] }.to_h
|
||||
@accounts = results.map { |f| accounts[f.account_id] }
|
||||
|
||||
set_account_counters_maps(@accounts)
|
||||
# set_account_counters_maps(@accounts)
|
||||
|
||||
next_path = api_v1_follow_requests_url(max_id: results.last.id) if results.size == DEFAULT_ACCOUNTS_LIMIT
|
||||
prev_path = api_v1_follow_requests_url(since_id: results.first.id) unless results.empty?
|
||||
|
Reference in New Issue
Block a user