diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-03-24 19:16:03 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-03-24 19:16:03 -0500 |
commit | e2097235b6d81a350f0a8d33980269fda63dec28 (patch) | |
tree | c856f27daed24356874412500aa6b17927ede5dd /activesupport/lib/active_support/cache/strategy/local_cache.rb | |
parent | 416099ca3fab795386b1138b78d9d01d9d5be016 (diff) | |
parent | ab6deeef9bfcd52e364ef83e01be1127121accd9 (diff) | |
download | rails-e2097235b6d81a350f0a8d33980269fda63dec28.tar.gz rails-e2097235b6d81a350f0a8d33980269fda63dec28.tar.bz2 rails-e2097235b6d81a350f0a8d33980269fda63dec28.zip |
Merge pull request #14466 from vipulnsward/rename-cache-method
Rename method and stop passing unused arguements.
Diffstat (limited to 'activesupport/lib/active_support/cache/strategy/local_cache.rb')
-rw-r--r-- | activesupport/lib/active_support/cache/strategy/local_cache.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/cache/strategy/local_cache.rb b/activesupport/lib/active_support/cache/strategy/local_cache.rb index 6afb07bd72..e9ee98a128 100644 --- a/activesupport/lib/active_support/cache/strategy/local_cache.rb +++ b/activesupport/lib/active_support/cache/strategy/local_cache.rb @@ -85,13 +85,13 @@ module ActiveSupport 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 @@ module ActiveSupport 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 @@ module ActiveSupport end end + private + def local_cache_key @local_cache_key ||= "#{self.class.name.underscore}_local_cache_#{object_id}".gsub(/[\/-]/, '_').to_sym end |