Skip to content

Commit

Permalink
Job Generator: Remove obsolete configuration
Browse files Browse the repository at this point in the history
The [introduction][] of `config/initializers/active_job.rb` was rendered
obsolete by [rails/rails#43390][].

[introduction]: 38b530c
[rails/rails#43390]: rails/rails#43390
  • Loading branch information
stevepolitodesign committed Apr 23, 2024
1 parent ea9553c commit f0853a0
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 38 deletions.
5 changes: 0 additions & 5 deletions lib/generators/suspenders/jobs_generator.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Suspenders
module Generators
class JobsGenerator < Rails::Generators::Base
source_root File.expand_path("../../templates/active_job", __FILE__)
desc <<~MARKDOWN
Installs Sidekiq for background job processing.
MARKDOWN
Expand All @@ -11,10 +10,6 @@ def add_sidekiq_gem
Bundler.with_unbundled_env { run "bundle install" }
end

def initialize_active_job
copy_file "active_job.rb", "config/initializers/active_job.rb"
end

def configure_active_job
environment "config.active_job.queue_adapter = :sidekiq"
environment "config.action_mailer.deliver_later_queue_name = nil"
Expand Down
14 changes: 0 additions & 14 deletions lib/generators/templates/active_job/active_job.rb

This file was deleted.

14 changes: 0 additions & 14 deletions test/fixtures/files/active_job.rb

This file was deleted.

6 changes: 1 addition & 5 deletions test/generators/suspenders/jobs_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ class JobsGeneratorTest < Rails::Generators::TestCase
end

test "configures ActiveJob logging" do
expected_configuration = file_fixture("active_job.rb").read

run_generator

assert_file app_root("config/initializers/active_job.rb") do |file|
assert_equal(expected_configuration, file)
end
assert_no_file app_root("config/initializers/active_job.rb")
end

test "adds ActiveJob configuration to the application file" do
Expand Down

0 comments on commit f0853a0

Please sign in to comment.