mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
Merge pull request #821 from piglop/define-method-fix
Fix for Debian Ruby 1.9
This commit is contained in:
commit
f9ea5ab20b
1 changed files with 3 additions and 2 deletions
|
@ -43,10 +43,11 @@ class DiscourseRedis
|
|||
lindex linsert llen lpop lpush lpushx lrange lrem lset ltrim mget move mset msetnx persist pexpire pexpireat psetex
|
||||
pttl rename renamenx rpop rpoplpush rpush rpushx sadd scard sdiff set setbit setex setnx setrange sinter
|
||||
sismember smembers sort spop srandmember srem strlen sunion ttl type watch zadd zcard zcount zincrby
|
||||
zrange zrangebyscore zrank zrem zremrangebyrank zremrangebyscore zrevrange zrevrangebyscore zrevrank zrangebyscore).each do |m|
|
||||
zrange zrangebyscore zrank zrem zremrangebyrank zremrangebyscore zrevrange zrevrangebyscore zrevrank zrangebyscore
|
||||
).map(&:to_sym).each do |m|
|
||||
define_method m do |*args|
|
||||
args[0] = "#{DiscourseRedis.namespace}:#{args[0]}"
|
||||
@redis.send(__method__, *args)
|
||||
@redis.send(m, *args)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue