From 020c2e57a4aa74c13bd9bd27cc54f3dcb9c0f8cd Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Tue, 10 Apr 2012 11:38:19 -0700 Subject: [PATCH] Fix dalli_store#delete error handling, #196 --- History.md | 1 + lib/active_support/cache/dalli_store.rb | 2 +- test/test_active_support.rb | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index a7bfb683..6ed9d4e9 100644 --- a/History.md +++ b/History.md @@ -5,6 +5,7 @@ HEAD ======= - Allow non-ascii and whitespace keys, only the text protocol has those restrictions [#145] +- Fix DalliStore#delete error-handling [#196] 2.0.2 ======= diff --git a/lib/active_support/cache/dalli_store.rb b/lib/active_support/cache/dalli_store.rb index 1e2c3d24..dffae9c4 100644 --- a/lib/active_support/cache/dalli_store.rb +++ b/lib/active_support/cache/dalli_store.rb @@ -72,7 +72,7 @@ def exist?(name, options=nil) end def delete(name, options=nil) - @data.delete(name) + delete_entry(name, options) end # Reads multiple keys from the cache using a single call to the diff --git a/test/test_active_support.rb b/test/test_active_support.rb index 1ec106a1..5f1b84f8 100644 --- a/test/test_active_support.rb +++ b/test/test_active_support.rb @@ -13,6 +13,7 @@ assert_equal 1, @dalli.increment('lkjsa', 1, nil) assert_equal 2, @dalli.increment('lkjsa', 1, nil) assert_equal 1, @dalli.decrement('lkjsa', 1, nil) + assert_equal true, @dalli.delete('lkjsa') end should 'support fetch' do