Files
leadchat/app/models/concerns/account_cache_revalidator.rb
Pranav Raj S e877b01e00 fix: Invalidate cache if any of the related objects change (#6860)
* fix: Invalidate cache if any of the related objects change

* Add specs:

* Update context

---------

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
2023-04-10 15:47:13 +05:30

12 lines
218 B
Ruby

module AccountCacheRevalidator
extend ActiveSupport::Concern
included do
after_commit :update_account_cache
end
def update_account_cache
account.update_cache_key(self.class.name.underscore)
end
end