Module: ActiveRecord::ConnectionAdapters::QueryCache
- Defined in:
- lib/rcache/query_cache.rb
Instance Attribute Summary collapse
-
#rcache_value ⇒ Object
Returns the value of attribute rcache_value.
Instance Method Summary collapse
Instance Attribute Details
#rcache_value ⇒ Object
Returns the value of attribute rcache_value.
4 5 6 |
# File 'lib/rcache/query_cache.rb', line 4 def rcache_value @rcache_value end |
Instance Method Details
#select_all(arel, name = nil, binds = []) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rcache/query_cache.rb', line 6 def select_all(arel, name = nil, binds = []) if @rcache_value && !locked?(arel) && (@rcache_value[:expires_in] || Rcache.expires_in).to_i > 0 sql = to_sql(arel, binds) redis_cache_sql(sql, binds) { super(sql, name, binds) } elsif @query_cache_enabled && !locked?(arel) sql = to_sql(arel, binds) cache_sql(sql, binds) { super(sql, name, binds) } else super end end |