Permalink
Browse files

Merge pull request #14466 from vipulnsward/rename-cache-method

Rename method and stop passing unused arguements.
  • Loading branch information...
2 parents 416099c + ab6deee commit e2097235b6d81a350f0a8d33980269fda63dec28 @rafaelfranca rafaelfranca committed Mar 25, 2014
Showing with 5 additions and 4 deletions.
  1. +5 −4 activesupport/lib/active_support/cache/strategy/local_cache.rb
@@ -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

0 comments on commit e209723

Please sign in to comment.