From 033c4d310a26293325c6ae653daf3e044305a123 Mon Sep 17 00:00:00 2001 From: Stephen Anderson Date: Wed, 27 Nov 2024 08:01:39 +1100 Subject: [PATCH] Resolve GlobalID::Locator.locate missing argument warning Add in an (unused) options arg for the TestLocator locate method to resolve the following deprecation warning thrown by Rails 7.1 when running the test suite: DEPRECATION WARNING: It seems your locator is defining the `locate` method only with one argument. Please make sure your locator is receiving the options argument as well, like `locate(gid, options = {})`. (called from run at /work/lib/que/active_job/extensions.rb:138) --- spec/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ac34bb5c..65c8635a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -113,7 +113,7 @@ class QueJob < ActiveRecord::Base end class TestLocator - def locate(gid) + def locate(gid, _options = {}) gid.model_name.constantize.find(gid.model_id) end end