* fix: Invalidate cache if any of the related objects change * Add specs: * Update context --------- Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
12 lines
218 B
Ruby
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
|