From 5859df4f8147d4a53823d45dfb2157118b709088 Mon Sep 17 00:00:00 2001 From: Dante Catalfamo Date: Fri, 28 Apr 2023 00:20:41 -0400 Subject: rails-test-cache: Add link to api docs --- content/posts/testing-rails-cache/index.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'content/posts') diff --git a/content/posts/testing-rails-cache/index.org b/content/posts/testing-rails-cache/index.org index 266a900..397eae4 100644 --- a/content/posts/testing-rails-cache/index.org +++ b/content/posts/testing-rails-cache/index.org @@ -8,14 +8,14 @@ #+SUMMARY: If you're in the default testing environment your rails cache is -=ActiveSupport::Cache::NullStore= which will always succeed but it +[[https://api.rubyonrails.org/classes/ActiveSupport/Cache/NullStore.html][=ActiveSupport::Cache::NullStore=]] which will always succeed but it doesn't actually store or return anything. There's an almost completely undocumented function called =with_local_cache= that gets implemented on =NullStore= that lets you run a block with a =MemoryStore= instead of a =NullStore=. This happens because it =prepends= the -=ActiveSupport::Cache::Strategy::LocalCache= class. +[[https://api.rubyonrails.org/classes/ActiveSupport/Cache/Strategy/LocalCache.html][=ActiveSupport::Cache::Strategy::LocalCache=]] class. #+begin_src ruby Rails.cache.class.name -- cgit v1.2.3