Class: ActiveRecord::Relation
- Inherits:
-
Object
- Object
- ActiveRecord::Relation
- Includes:
- PgCacheKey
- Defined in:
- lib/pg_cache_key.rb
Overview
Active Record Relation
Constant Summary
Constants included from PgCacheKey
Instance Method Summary collapse
Methods included from PgCacheKey
Instance Method Details
#cache_key(timestamp_column = :updated_at) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/pg_cache_key.rb', line 32 def cache_key( = :updated_at) return "#{self.class.to_s.underscore}/blank" if to_sql.blank? @cache_keys ||= {} @cache_keys[] ||= connection.execute( cache_key_raw_sql() )[0]['cache_key'] @cache_keys[] ||= collection_cache_key end |