You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your collection cache depends on multiple sources (try to avoid this to keep things simple), you can name all these dependencies as part of a block that returns an array:
296
+
297
+
```ruby
298
+
json.array! @posts, partial:"posts/post", as::post, cached:-> post { [post, current_user] }
299
+
```
300
+
301
+
This will include both records as part of the cache key and updating either of them will expire the cache.
302
+
295
303
## Formatting Keys
296
304
297
305
Keys can be auto formatted using `key_format!`, this can be used to convert
0 commit comments