Fix: Support Ruby 3 keyword arguments for DiscourseRedis (#14444)

Fix: Support Ruby 3 keyword arguments for DiscourseRedis (#14444)

diff --git a/lib/discourse_redis.rb b/lib/discourse_redis.rb
index 33390d4..45902dc 100644
--- a/lib/discourse_redis.rb
+++ b/lib/discourse_redis.rb
@@ -37,7 +37,7 @@ class DiscourseRedis
   end
 
   # prefix the key with the namespace
-  def method_missing(meth, *args, &block)
+  def method_missing(meth, *args, **kwargs, &block)
     if @redis.respond_to?(meth)
       DiscourseRedis.ignore_readonly { @redis.public_send(meth, *args, &block) }
     else
@@ -54,9 +54,9 @@ class DiscourseRedis
    :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|
-    define_method m do |*args|
+    define_method m do |*args, **kwargs|
       args[0] = "#{namespace}:#{args[0]}" if @namespace
-      DiscourseRedis.ignore_readonly { @redis.public_send(m, *args) }
+      DiscourseRedis.ignore_readonly { @redis.public_send(m, *args, **kwargs) }
     end
   end
 

GitHub sha: d06d09f479c5a0b4e911001d9c804521618c98f7

This commit appears in #14444 which was approved by tgxworld. It was merged by tgxworld.