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.
This commit is contained in:
1 file changed
+6
-3
+6
-3
@@ -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
|
||||
Reference in new issue
Block a user