diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-03-04 17:58:58 -0800 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-03-04 17:58:58 -0800 |
commit | ccf8f27dddcc36fa5c91f614647e0b0bac861d83 (patch) | |
tree | 066275df7d4ce82bcc7901bdfb75bfc21cd74b08 /activesupport/test | |
parent | 475c96589ca65282e1a61350271c2f83f0d4044f (diff) | |
download | rails-ccf8f27dddcc36fa5c91f614647e0b0bac861d83.tar.gz rails-ccf8f27dddcc36fa5c91f614647e0b0bac861d83.tar.bz2 rails-ccf8f27dddcc36fa5c91f614647e0b0bac861d83.zip |
Revert "Merge pull request #14269 from arthurnn/expanded_key_array"
This reverts commit 475c96589ca65282e1a61350271c2f83f0d4044f, reversing
changes made to 705915ab5cf24430892107764b0050c07e1df583.
We decided that this is not worth busting everyone's cache as this
seems like a very unlikely problem. The problem only occurs when the
user is 1) not using a namespace, or 2) using the same namesapce for
different *kinds* of cache items. The recommended "fix" is to put
those cache items into their own namspace:
id = 1
Rails.cache.fetch(id, namespace: "user"){ User.find(id) }
ids = [1]
Rails.cache.fetch(ids, namespace: "users"){ User.find(ids) }
See the discussion on #14269 for details.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/caching_test.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index 64d8792dde..18923f61d1 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -257,10 +257,6 @@ module CacheStoreBehavior assert_nil @cache.fetch('foo') { 'baz' } end - def test_fetch_with_array_and_without - assert_not_equal @cache.fetch('foo') { 'barz' }, @cache.fetch(['foo']) { 'barr' } - end - def test_should_read_and_write_hash assert @cache.write('foo', {:a => "b"}) assert_equal({:a => "b"}, @cache.read('foo')) @@ -353,7 +349,7 @@ module CacheStoreBehavior def test_array_as_cache_key @cache.write([:fu, "foo"], "bar") - assert_equal "bar", @cache.read("fu/foo/") + assert_equal "bar", @cache.read("fu/foo") end def test_hash_as_cache_key |