counter-cache-credis 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b26246e85681bfd50669fafcb38791677782facf
4
- data.tar.gz: 5957a0dc5d94bc8e97c384fdca78b8b7e82a7a35
3
+ metadata.gz: 0659026d81d19b19e71bbf5120cac135877778b2
4
+ data.tar.gz: 5cb0f7319b034f61a185d24b29ef570662e8592c
5
5
  SHA512:
6
- metadata.gz: 967441b5d6ecbc769e5081c4c89029a36a16fd4014ae926d73e54b92dd57ea0978c33b88f0b55948c572a14141abb3ac2b8a0763a2fe2469f4086725ab4de9bf
7
- data.tar.gz: 5c854609a04a1c1bdfe4e17790620a65b2599f63ecaffcbac73ad832d2ca22c8971936761fb519bf37e7895e4c6c99de4527a54cb397f56820980f580d80386c
6
+ metadata.gz: 30978b4e3e69c1d6a339ebf0e8f628e316fc9bb0638d5d71004dcd508e9b0501664c3eb7f1297b1b9b8b41519e8ef3412cd1599c279f34fdc678b2fa57ec4a71
7
+ data.tar.gz: 68931ac0e8975c3436bf66c7a466ff7787e319b3f6e27c3ad8e3548be8424e58a73ccff38001b34c8cd236da7f9dae7e33b7858e3de217305086b3bee7d5880e
@@ -11,7 +11,7 @@ module Counter
11
11
  def defind_column_getter(column)
12
12
  self.class_eval do
13
13
  define_method("get_#{column}_cache") do
14
- self.send(column) + Redis.new.get("#{self.class.table_name}/#{column}#{self.id}").to_i
14
+ self.send(column) + RedisCli.new.get("#{self.class.table_name}/#{column}#{self.id}").to_i
15
15
  end
16
16
  end
17
17
  end
@@ -33,6 +33,7 @@ module Counter
33
33
  # 修改值
34
34
  def update_counter(column = 'views_count')
35
35
  redis = RedisCli.new
36
+ p redis
36
37
  views_count_redis = redis.get("#{self.class.table_name}/#{column}#{self.id}").to_i
37
38
  views_count_redis = 0 if !views_count_redis
38
39
  views_count_redis += 1
@@ -1,7 +1,7 @@
1
1
  module Counter
2
2
  module Cache
3
3
  module Credis
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: counter-cache-credis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - linjunzhu