diff options
Diffstat (limited to 'content/posts/testing-rails-cache')
-rw-r--r-- | content/posts/testing-rails-cache/index.org | 4 |
1 files changed, 2 insertions, 2 deletions
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 |