2018-02-18 13:14:46 +11:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module RelationshipCacheable
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
after_commit :remove_relationship_cache
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def remove_relationship_cache
|
2023-12-19 03:14:43 +11:00
|
|
|
Rails.cache.delete(['relationship', account_id, target_account_id])
|
|
|
|
Rails.cache.delete(['relationship', target_account_id, account_id])
|
2018-02-18 13:14:46 +11:00
|
|
|
end
|
|
|
|
end
|