Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Rename `increment_or_decrement` to an apt `set_cache_value` since i…

…t actually doesn't increment/decrement in localstore.
  • Loading branch information...
commit ab6deeef9bfcd52e364ef83e01be1127121accd9 1 parent 8bd2912
Vipul A M vipulnsward authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 activesupport/lib/active_support/cache/strategy/local_cache.rb
9 activesupport/lib/active_support/cache/strategy/local_cache.rb
View
@@ -85,13 +85,13 @@ def cleanup(options = nil) # :nodoc:
def increment(name, amount = 1, options = nil) # :nodoc:
value = bypass_local_cache{super}
- increment_or_decrement(value, name, amount, options)
+ set_cache_value(value, name, amount, options)
value
end
def decrement(name, amount = 1, options = nil) # :nodoc:
value = bypass_local_cache{super}
- increment_or_decrement(value, name, amount, options)
+ set_cache_value(value, name, amount, options)
value
end
@@ -119,8 +119,7 @@ def delete_entry(key, options) # :nodoc:
super
end
- private
- def increment_or_decrement(value, name, amount, options)
+ def set_cache_value(value, name, amount, options)
if local_cache
local_cache.mute do
if value
@@ -132,6 +131,8 @@ def increment_or_decrement(value, name, amount, options)
end
end
+ private
+
def local_cache_key
@local_cache_key ||= "#{self.class.name.underscore}_local_cache_#{object_id}".gsub(/[\/-]/, '_').to_sym
end
Please sign in to comment.
Something went wrong with that request. Please try again.