mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use cache_key_with_version instead of cache_key for the example in Low-Level Caching [ci skip]
This commit is contained in:
parent
82fc7cdef5
commit
95f9af8257
1 changed files with 1 additions and 1 deletions
|
@ -295,7 +295,7 @@ Consider the following example. An application has a `Product` model with an ins
|
|||
```ruby
|
||||
class Product < ApplicationRecord
|
||||
def competing_price
|
||||
Rails.cache.fetch("#{cache_key}/competing_price", expires_in: 12.hours) do
|
||||
Rails.cache.fetch("#{cache_key_with_version}/competing_price", expires_in: 12.hours) do
|
||||
Competitor::API.find_price(id)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue