mirror of https://github.com/mastodon/mastodon
Extract shared callback behaviour to `CustomFilterCache` concern (#29695)
parent
285a87a77f
commit
c0fe8a9f13
@ -0,0 +1,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
|
Loading…
Reference in New Issue