aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache
diff options
context:
space:
mode:
authorLeonel Galán <leonel@getstealz.com>2017-05-17 15:23:21 -0400
committerGitHub <noreply@github.com>2017-05-17 15:23:21 -0400
commit0804e58e1e6a52190a950f863622102b6b21ccb8 (patch)
treea2d9887906bd2c472edc54907362b93a57f52f0f /activesupport/lib/active_support/cache
parentf5b2a0ef408f01dd9f12b456f5e4bb41ebb4cb76 (diff)
parent385d9af299fbfac7f063de214d371545bafef5df (diff)
downloadrails-0804e58e1e6a52190a950f863622102b6b21ccb8.tar.gz
rails-0804e58e1e6a52190a950f863622102b6b21ccb8.tar.bz2
rails-0804e58e1e6a52190a950f863622102b6b21ccb8.zip
Merge branch 'master' into bug/filtered_parameters_class
Diffstat (limited to 'activesupport/lib/active_support/cache')
-rw-r--r--activesupport/lib/active_support/cache/strategy/local_cache.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/cache/strategy/local_cache.rb b/activesupport/lib/active_support/cache/strategy/local_cache.rb
index 672eb2bb80..91875a56f5 100644
--- a/activesupport/lib/active_support/cache/strategy/local_cache.rb
+++ b/activesupport/lib/active_support/cache/strategy/local_cache.rb
@@ -115,7 +115,12 @@ module ActiveSupport
end
def write_entry(key, entry, options)
- local_cache.write_entry(key, entry, options) if local_cache
+ if options[:unless_exist]
+ local_cache.delete_entry(key, options) if local_cache
+ else
+ local_cache.write_entry(key, entry, options) if local_cache
+ end
+
super
end