From 911d2a5855e0d0c0f401b70e89d27d8b5a7a5c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Tue, 6 Oct 2026 15:06:20 +0200 Subject: [PATCH] Fix db seeds for Solid Queue db/seeds.rb still required "sidekiq/testing" and wrapped seeding in Sidekiq::Testing.inline!, but Sidekiq is no longer in the bundle after the Solid Queue migration, so `rails db:setup` failed with a LoadError. Run the jobs triggered while seeding inline via Active Job instead, restoring the previous behavior with the adapter the app actually uses. --- db/seeds.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 9a91f9a..d7eaaa2 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,8 +1,9 @@ -require 'sidekiq/testing' - ldap = LdapService.new -Sidekiq::Testing.inline! do +original_queue_adapter = ActiveJob::Base.queue_adapter +ActiveJob::Base.queue_adapter = :inline + +begin ldap.delete_all_users! puts "Create user: admin" @@ -25,4 +26,6 @@ Sidekiq::Testing.inline! do password: "user is user", confirmed: true }) end +ensure + ActiveJob::Base.queue_adapter = original_queue_adapter end -- 2.50.1