mastodon/app/models/concerns/relationship_cacheable.rb
2026-02-06 14:36:12 +00:00

17 lines
357 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(['relationships', account_id, target_account_id])
Rails.cache.delete(['relationships', target_account_id, account_id])
end
end