From cba2897108dffe69d5a16befe6c6220f6eaae59f Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 18 Feb 2018 03:14:46 +0100 Subject: Cache relationships in API (#6482) * Cache relationships in API * Fetch relationships for search results in UI * Only save one account's maps in each cache item --- app/models/mute.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/models/mute.rb') diff --git a/app/models/mute.rb b/app/models/mute.rb index 948f22444..8efa27ac0 100644 --- a/app/models/mute.rb +++ b/app/models/mute.rb @@ -13,14 +13,14 @@ class Mute < ApplicationRecord include Paginable + include RelationshipCacheable belongs_to :account belongs_to :target_account, class_name: 'Account' validates :account_id, uniqueness: { scope: :target_account_id } - after_create :remove_blocking_cache - after_destroy :remove_blocking_cache + after_commit :remove_blocking_cache private -- cgit