mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue