From e0891d13e35296f1c89c68c1a430312df1e03c89 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 24 Jul 2025 11:34:27 +0200 Subject: [PATCH] ActiveRecord db patch: support kwargs This change follows the newrelic inspiration that the original of this file was linking to. --- lib/patches/db/activerecord.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/patches/db/activerecord.rb b/lib/patches/db/activerecord.rb index e30fa78f..667c6f59 100644 --- a/lib/patches/db/activerecord.rb +++ b/lib/patches/db/activerecord.rb @@ -15,12 +15,12 @@ def self.included(instrumented_class) end end - def log_with_miniprofiler(*args, &block) - return log_without_miniprofiler(*args, &block) unless SqlPatches.should_measure? + def log_with_miniprofiler(*args, **kwargs, &block) + return log_without_miniprofiler(*args, **kwargs, &block) unless SqlPatches.should_measure? sql, name, binds = args start = Process.clock_gettime(Process::CLOCK_MONOTONIC) - rval = log_without_miniprofiler(*args, &block) + rval = log_without_miniprofiler(*args, **kwargs, &block) # Don't log schema queries if the option is set return rval if Rack::MiniProfiler.config.skip_schema_queries && name =~ (/SCHEMA/)