1
0
Fork 0
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:
Alex Ghiculescu 2021-12-27 19:02:39 -06:00 committed by GitHub
parent 51b8ddf49e
commit 346f43f2b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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