diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-03-30 15:06:59 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-03-30 15:06:59 +0200 |
commit | de22c202f5e103f433926c763fc3ae179d5976ad (patch) | |
tree | 328a69859cf55572899d673ddc40fa598b23ac46 /app/models/favourite.rb | |
parent | 333e44c3fc687b1f6215db99283536b293cf937f (diff) |
Add counter caches for a large performance increase on API requests
Diffstat (limited to 'app/models/favourite.rb')
-rw-r--r-- | app/models/favourite.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/favourite.rb b/app/models/favourite.rb index 67a293888..41d06e734 100644 --- a/app/models/favourite.rb +++ b/app/models/favourite.rb @@ -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 |