Skip to content

Commit d016520

Browse files
authored
Merge pull request rails#54917 from fatkodima/fix-configuring-redis-raw
Fix configuring `RedisCacheStore` with `raw: true`
2 parents b97917d + 2696081 commit d016520

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

activesupport/lib/active_support/cache.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module Cache
3535
:race_condition_ttl,
3636
:serializer,
3737
:skip_nil,
38+
:raw,
3839
]
3940

4041
# Mapping of canonical option names to aliases that a store will recognize.

activesupport/test/cache/behaviors/cache_store_behavior.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,12 @@ def test_setting_options_in_fetch_block_does_not_change_cache_options
742742
end
743743
end
744744

745+
def test_configuring_store_with_raw
746+
cache = lookup_store(raw: true)
747+
cache.write("foo", "bar")
748+
assert_equal "bar", cache.read("foo")
749+
end
750+
745751
private
746752
def with_raise_on_invalid_cache_expiration_time(new_value, &block)
747753
old_value = ActiveSupport::Cache::Store.raise_on_invalid_cache_expiration_time

0 commit comments

Comments
 (0)