From 6d23d40420e4548778f3ca4ed9e8cb16e0eb0073 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 1 Jul 2020 19:05:21 +0200 Subject: Change Redis#exists calls to Redis#exists? to avoid deprecation warning (#14191) --- lib/redis/namespace_extensions.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/redis/namespace_extensions.rb (limited to 'lib/redis') diff --git a/lib/redis/namespace_extensions.rb b/lib/redis/namespace_extensions.rb new file mode 100644 index 000000000..310a4f465 --- /dev/null +++ b/lib/redis/namespace_extensions.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class Redis + module NamespaceExtensions + def exists?(*args, &block) + call_with_namespace('exists?', *args, &block) + end + end +end + +Redis::Namespace::COMMANDS['exists?'] = [:first] +Redis::Namespace.prepend(Redis::NamespaceExtensions) -- cgit