Sha256: cd18c6fdc6a513cc19fb9dfb40a8382eb10c643dcc6ac3aa86d6106e33c066a4
Contents?: true
Size: 692 Bytes
Versions: 11
Compression:
Stored size: 692 Bytes
Contents
# -*- encoding : utf-8 -*- module SecondLevelCache module ActiveRecord module Base extend ActiveSupport::Concern included do after_commit :expire_second_level_cache, :on => :destroy after_commit :update_second_level_cache, :on => :update after_commit :write_second_level_cache, :on => :create class << self alias_method_chain :update_counters, :cache end end module ClassMethods def update_counters_with_cache(id, counters) update_counters_without_cache(id, counters).tap do Array(id).each{|i| expire_second_level_cache(i)} end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems