diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-03 13:28:36 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-03 13:28:36 +0100 |
commit | 0160d1d9b5195e5d8fcb94b29f74634b129439b4 (patch) | |
tree | 05c4978fea002d562daceb8a30305e3f701e9198 /app/models | |
parent | aff22bfdb554207ae73b8946310f7328f645be70 (diff) |
Enable caching for some rabl views
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/favourite.rb | 2 | ||||
-rw-r--r-- | app/models/status.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/favourite.rb b/app/models/favourite.rb index 4f9b20942..8b8082f1e 100644 --- a/app/models/favourite.rb +++ b/app/models/favourite.rb @@ -2,7 +2,7 @@ class Favourite < ApplicationRecord include Streamable belongs_to :account, inverse_of: :favourites - belongs_to :status, inverse_of: :favourites + belongs_to :status, inverse_of: :favourites, touch: true validates :status_id, uniqueness: { scope: :account_id } diff --git a/app/models/status.rb b/app/models/status.rb index 19c0488d0..1cd56c97b 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -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 |