summaryrefslogtreecommitdiffstats
path: root/app/models/concerns/custom_filter_cache.rb
blob: 79b22f11f1e15b32b15af355f93fc8eef39e5412 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module CustomFilterCache
  extend ActiveSupport::Concern

  included do
    after_commit :invalidate_cache!
    before_destroy :prepare_cache_invalidation!
    before_save :prepare_cache_invalidation!

    delegate(
      :invalidate_cache!,
      :prepare_cache_invalidation!,
      to: :custom_filter
    )
  end
end