Create Redisable#redis (#9633)
* Create Redisable * Use #redis instead of Redis.current
This commit is contained in:
parent
6a5e3da6b0
commit
bcfff65195
13 changed files with 39 additions and 59 deletions
|
@ -4,6 +4,8 @@ class ActivityTracker
|
|||
EXPIRE_AFTER = 90.days.seconds
|
||||
|
||||
class << self
|
||||
include Redisable
|
||||
|
||||
def increment(prefix)
|
||||
key = [prefix, current_week].join(':')
|
||||
|
||||
|
@ -20,10 +22,6 @@ class ActivityTracker
|
|||
|
||||
private
|
||||
|
||||
def redis
|
||||
Redis.current
|
||||
end
|
||||
|
||||
def current_week
|
||||
Time.zone.today.cweek
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue