logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

relationship_cacheable.rb (359B)


  1. # frozen_string_literal: true
  2. module RelationshipCacheable
  3. extend ActiveSupport::Concern
  4. included do
  5. after_commit :remove_relationship_cache
  6. end
  7. private
  8. def remove_relationship_cache
  9. Rails.cache.delete("relationship:#{account_id}:#{target_account_id}")
  10. Rails.cache.delete("relationship:#{target_account_id}:#{account_id}")
  11. end
  12. end