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
@ -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 New Issue
Block a user