module ActiveRecord::Integration
def cache_version
Note, this method will return nil if ActiveRecord::Base.cache_versioning is set to
cache_version, but this method can be overwritten to return something else.
a recyclable caching scheme. By default, the #updated_at column is used for the
Returns a cache version that can be used together with the cache key to form
def cache_version return unless cache_versioning if has_attribute?("updated_at") timestamp = updated_at_before_type_cast if can_use_fast_cache_version?(timestamp) raw_timestamp_to_cache_version(timestamp) elsif timestamp = updated_at timestamp.utc.to_fs(cache_timestamp_format) end elsif self.class.has_attribute?("updated_at") raise ActiveModel::MissingAttributeError, "missing attribute 'updated_at' for #{self.class}" end end