Please sign in to comment.
Merge pull request #10234 from dasch/dasch/fetch-multi
Allow fetching multiple values from the cache at once
- Loading branch information...
Showing with 61 additions and 1 deletion.
|@@ -1,3 +1,15 @@|
|-* No changes.|
|+* Add a `fetch_multi` method to the cache stores. The method provides|
|+ an easy to use API for fetching multiple values from the cache.|
|+ # Calculating scores is expensive, so we only do it for posts|
|+ # that have been updated. Cache keys are automatically extracted|
|+ # from objects that define a #cache_key method.|
|+ scores = Rails.cache.fetch_multi(*posts) do |post||
|+ *Daniel Schierbeck*|
|Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/activesupport/CHANGELOG.md) for previous changes.|