Module: LowCardTables::LowCardTable::CacheExpiration::HasCacheExpiration

Extended by:
ActiveSupport::Concern
Included in:
LowCardTables, Base
Defined in:
lib/low_card_tables/low_card_table/cache_expiration/has_cache_expiration.rb

Overview

This is a module that gets mixed in to LowCardTables::LowCardTable::Base. It provides the class it gets mixed into with a #low_card_cache_expiration method that can be called with various values (a number, zero, :unlimited, or :exponential with options) to set the cache-expiration policy, or called with no arguments to return the cache-expiration policy as one of those same values.

The value is stored on a class-by-class basis, and is inherited. This provides the behavior we want: if you set a policy on LowCardTables::LowCardTable::Base, it will be applied to all low-card tables; if you set a policy on an individual table, it will apply to only that table and will override any policy applied to the base.

Defined Under Namespace

Modules: ClassMethods