- Inheritance
Attributes
Name | Visibility | R/W | Description |
---|---|---|---|
query_cache | public | R | |
query_cache_enabled | public | R |
Methods
Class
Visibility | Signature |
---|---|
public | dirties_query_cache (base, *method_names) |
public | included (base) |
Instance
Visibility | Signature |
---|---|
public | cache () {|| ...} |
public | clear_query_cache () |
public | columns_with_query_cache (*args) |
public | select_all_with_query_cache (*args) |
public | uncached () {|| ...} |
Class Method Detail
dirties_query_cache(base, *method_names)
included(base)
Instance Method Detail
cache() {|| ...}
Enable the query cache within the block.
clear_query_cache()
Clears the query cache.
One reason you may wish to call this method explicitly is between queries that ask the database to randomize results. Otherwise the cache would see the same SQL query and repeatedly return the same result each time, silently undermining the randomness you were expecting.
columns_with_query_cache(*args)
select_all_with_query_cache(*args)
uncached() {|| ...}
Disable the query cache within the block.