0
0
Fork 0

Enable caching for some rabl views

This commit is contained in:
Eugen Rochko 2016-11-03 13:28:36 +01:00
parent aff22bfdb5
commit 0160d1d9b5
11 changed files with 38 additions and 32 deletions

View file

@ -5,7 +5,7 @@ class Status < ApplicationRecord
belongs_to :account, -> { with_counters }, inverse_of: :statuses
belongs_to :thread, foreign_key: 'in_reply_to_id', class_name: 'Status', inverse_of: :replies
belongs_to :reblog, foreign_key: 'reblog_of_id', class_name: 'Status', inverse_of: :reblogs
belongs_to :reblog, foreign_key: 'reblog_of_id', class_name: 'Status', inverse_of: :reblogs, touch: true
has_many :favourites, inverse_of: :status, dependent: :destroy
has_many :reblogs, foreign_key: 'reblog_of_id', class_name: 'Status', inverse_of: :reblog, dependent: :destroy