mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 09:04:00 -05:00
17 lines
355 B
Ruby
17 lines
355 B
Ruby
# frozen_string_literal: true
|
|
|
|
module RelationshipCacheable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
after_commit :remove_relationship_cache
|
|
end
|
|
|
|
private
|
|
|
|
def remove_relationship_cache
|
|
Rails.cache.delete(['relationship', account_id, target_account_id])
|
|
Rails.cache.delete(['relationship', target_account_id, account_id])
|
|
end
|
|
end
|