module CachedCounts

Constants

VERSION

Attributes

connection_for[W]

Optional configuration: set a proc which takes the class we are counting and returns a connection. Useful with replication, e.g. with Octopus:

`CachedCounts.connection_for = proc { |klass| klass.using(:read_slave).connection }`

Public Class Methods

connection_for(counted_class) click to toggle source
# File lib/cached_counts/connection_for.rb, line 9
def connection_for(counted_class)
  @connection_for ||= proc { |klass| klass.connection }
  @connection_for[counted_class]
end