Sha256: cc37a3ee2653ab3766dae918af3d06061a873240f4cc14f9a946ac8ea4722f9b
Contents?: true
Size: 613 Bytes
Versions: 11
Compression:
Stored size: 613 Bytes
Contents
require 'active_support' module CachedCounts module ActiveRecordRelationMethods extend ActiveSupport::Concern included do alias_method_chain :count, :caching alias_method_chain :length, :caching alias_method_chain :size, :caching end def count_with_caching(*args) CachedCounts::Cache.new(self).count end def length_with_caching(*args) CachedCounts::Cache.new(self).count end def size_with_caching(*args) CachedCounts::Cache.new(self).count end def clear_count_cache CachedCounts::Cache.new(self).clear end end end
Version data entries
11 entries across 11 versions & 1 rubygems