about summary refs log tree commit diff
path: root/app/models/block.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-02-18 03:14:46 +0100
committerGitHub <noreply@github.com>2018-02-18 03:14:46 +0100
commitcba2897108dffe69d5a16befe6c6220f6eaae59f (patch)
treee247261ff56fa1751e914d650a4a4710c6417dd1 /app/models/block.rb
parent9b8a4484778fb55bcb2526992807a51270229b72 (diff)
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
Diffstat (limited to 'app/models/block.rb')
-rw-r--r--app/models/block.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/block.rb b/app/models/block.rb
index 441e6bca3..d6ecabd3b 100644
--- a/app/models/block.rb
+++ b/app/models/block.rb
@@ -12,14 +12,14 @@
 
 class Block < 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