Add counter caches for a large performance increase on API requests
This commit is contained in:
parent
333e44c3fc
commit
de22c202f5
13 changed files with 41 additions and 22 deletions
|
@ -4,7 +4,7 @@ class Favourite < ApplicationRecord
|
|||
include Paginable
|
||||
|
||||
belongs_to :account, inverse_of: :favourites
|
||||
belongs_to :status, inverse_of: :favourites
|
||||
belongs_to :status, inverse_of: :favourites, counter_cache: true
|
||||
|
||||
has_one :notification, as: :activity, dependent: :destroy
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue