class ActiveRecord::Relation

Active Record Relation

Public Instance Methods

cache_key(timestamp_column = :updated_at) click to toggle source
# File lib/pg_cache_key.rb, line 32
def cache_key(timestamp_column = :updated_at)
  return "#{self.class.to_s.underscore}/blank" if to_sql.blank?
  @cache_keys ||= {}
  @cache_keys[timestamp_column] ||= connection.execute( cache_key_raw_sql(timestamp_column) )[0]['cache_key']
  @cache_keys[timestamp_column] ||= collection_cache_key
end