mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-22 05:54:55 +00:00
* feat: set cache keys for 3 days only * feat: invalidate should set the latest timestamp * refactor: cache_keys concern * remove invalidate_cache method * refactor reset to set to new value instead of delete * ensure only one event is dispatched * feat: set expiry to 24 hours * chore: make expiry 48 hours * feat: include destroy event * feat: set expiry to 72 days * fix: typo * test: cache update after `touch` * test: update cache keys * refactor: remove after_touch, it's already handled in commit
12 lines
252 B
Ruby
12 lines
252 B
Ruby
module AccountCacheRevalidator
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
after_commit :update_account_cache, on: [:create, :update, :destroy]
|
|
end
|
|
|
|
def update_account_cache
|
|
account.update_cache_key(self.class.name.underscore)
|
|
end
|
|
end
|