public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
MemCacheStore#decrement should use data instance variable not local 
variable [#521 state:resolved]
josh (author)
Wed Jul 16 16:46:04 -0700 2008
commit  7ae2105d57d3c08bebde44bd72093dd43c48d613
tree    8fa1e345c23740b60a8bd0c02a4a917acfa9aebf
parent  73ade4fe100ae7f48c5f95dcdf7067f6a0cd51fa
...
29
30
31
32
33
 
 
34
35
36
...
56
57
58
59
 
60
61
62
 
 
63
64
 
65
66
67
68
69
70
71
 
 
72
73
 
74
75
76
 
 
77
78
79
80
81
 
 
82
83
84
85
 
 
86
87
88
...
29
30
31
 
 
32
33
34
35
36
...
56
57
58
 
59
60
 
 
61
62
63
 
64
65
66
67
68
69
 
 
70
71
72
 
73
74
 
 
75
76
77
78
79
 
 
80
81
82
83
 
 
84
85
86
87
88
0
@@ -29,8 +29,8 @@ module ActiveSupport
0
         nil
0
       end
0
 
0
- # Set key = value. Pass :unless_exist => true if you don't
0
- # want to update the cache if the key is already set.
0
+ # Set key = value. Pass :unless_exist => true if you don't
0
+ # want to update the cache if the key is already set.
0
       def write(key, value, options = nil)
0
         super
0
         method = options && options[:unless_exist] ? :add : :set
0
@@ -56,33 +56,33 @@ module ActiveSupport
0
         !read(key, options).nil?
0
       end
0
 
0
- def increment(key, amount = 1)
0
+ def increment(key, amount = 1)
0
         log("incrementing", key, amount)
0
-
0
- response = @data.incr(key, amount)
0
+
0
+ response = @data.incr(key, amount)
0
         response == Response::NOT_FOUND ? nil : response
0
- rescue MemCache::MemCacheError
0
+ rescue MemCache::MemCacheError
0
         nil
0
       end
0
 
0
       def decrement(key, amount = 1)
0
         log("decrement", key, amount)
0
-
0
- response = data.decr(key, amount)
0
+
0
+ response = @data.decr(key, amount)
0
         response == Response::NOT_FOUND ? nil : response
0
- rescue MemCache::MemCacheError
0
+ rescue MemCache::MemCacheError
0
         nil
0
- end
0
-
0
+ end
0
+
0
       def delete_matched(matcher, options = nil)
0
         super
0
         raise "Not supported by Memcache"
0
- end
0
-
0
+ end
0
+
0
       def clear
0
         @data.flush_all
0
- end
0
-
0
+ end
0
+
0
       def stats
0
         @data.stats
0
       end

Comments

    No one has commented yet.