mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
DEV: Prefer public_send
over send
.
This commit is contained in:
parent
9be70a22cd
commit
152238b4cf
74 changed files with 216 additions and 129 deletions
|
@ -184,7 +184,7 @@ class DiscourseRedis
|
|||
# prefix the key with the namespace
|
||||
def method_missing(meth, *args, &block)
|
||||
if @redis.respond_to?(meth)
|
||||
DiscourseRedis.ignore_readonly { @redis.send(meth, *args, &block) }
|
||||
DiscourseRedis.ignore_readonly { @redis.public_send(meth, *args, &block) }
|
||||
else
|
||||
super
|
||||
end
|
||||
|
@ -201,7 +201,7 @@ class DiscourseRedis
|
|||
:zremrangebyscore, :zrevrange, :zrevrangebyscore, :zrevrank, :zrangebyscore ].each do |m|
|
||||
define_method m do |*args|
|
||||
args[0] = "#{namespace}:#{args[0]}" if @namespace
|
||||
DiscourseRedis.ignore_readonly { @redis.send(m, *args) }
|
||||
DiscourseRedis.ignore_readonly { @redis.public_send(m, *args) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue