Fix db seeds for Solid Queue
CI / Test (pull_request) Successful in 45s
Release Drafter / Update release notes draft (pull_request) Successful in 3s

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.
This commit is contained in:
raucao committed 2026-10-06 13:36:33 +00:00
1 parent d8bba02636
commit 911d2a5855
1 file changed
+6 -3
+6 -3
View File
@@ -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