Skip to content

Commit a58d5a7

Browse files
committed
Set solid_queue as AJ adapter only in production via generator
It doesn't quite work correclty yet in test or dev environments.
1 parent d903c82 commit a58d5a7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/generators/solid_queue/install/install_generator.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ class SolidQueue::InstallGenerator < Rails::Generators::Base
66
class_option :skip_migrations, type: :boolean, default: nil, desc: "Skip migrations"
77

88
def add_solid_queue
9-
%w[ development test production ].each do |env_name|
10-
if (env_config = Pathname(destination_root).join("config/environments/#{env_name}.rb")).exist?
11-
gsub_file env_config, /(# )?config\.active_job\.queue_adapter\s+=.*/, "config.active_job.queue_adapter = :solid_queue"
12-
end
9+
if (env_config = Pathname(destination_root).join("config/environments/production.rb")).exist?
10+
gsub_file env_config, /(# )?config\.active_job\.queue_adapter\s+=.*/, "config.active_job.queue_adapter = :solid_queue"
1311
end
1412

1513
copy_file "config.yml", "config/solid_queue.yml"

0 commit comments

Comments
 (0)