mirror of https://github.com/rails/rails
Update guides/source/caching_with_rails.md
Co-authored-by: Juan Manuel Ramallo <juanmanuelramallo@hey.com>
This commit is contained in:
parent
51b8ddf49e
commit
346f43f2b5
|
@ -316,7 +316,7 @@ Instead, cache the ID or some other primitive data type. For example:
|
|||
ids = Rails.cache.fetch("super_admin_user_ids", expires_in: 12.hours) do
|
||||
User.super_admins.pluck(:id)
|
||||
end
|
||||
User.where(id: id).to_a
|
||||
User.where(id: ids).to_a
|
||||
```
|
||||
|
||||
### SQL Caching
|
||||
|
|
Loading…
Reference in New Issue