Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (21 sloc) 0.571 kB
# -*- encoding : utf-8 -*-
module SecondLevelCache
module ActiveRecord
module Base
extend ActiveSupport::Concern
included do
after_destroy :expire_second_level_cache
after_save :write_second_level_cache
class << self
alias_method_chain :update_counters, :cache
end
end
module ClassMethods
def update_counters_with_cache(id, counters)
Array(id).each{|i| expire_second_level_cache(i)}
update_counters_without_cache(id, counters)
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.