1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Revert "Merge pull request #39472"

This change broke config.active_job.queue_name_prefix with eager-loading enabled (i.e. in production, by default).

This reverts commit a173a65730, reversing
changes made to 89414f561a.
This commit is contained in:
George Claghorn 2020-12-17 19:27:14 -05:00
parent 2c4cbf26c8
commit c89632abf0
2 changed files with 16 additions and 22 deletions

View file

@ -13,22 +13,27 @@ module ActiveJob
ActiveSupport.on_load(:active_job) { self.logger = ::Rails.logger }
end
initializer "active_job.set_configs" do
config.after_initialize do |app|
initializer "active_job.custom_serializers" do |app|
config.after_initialize do
custom_serializers = app.config.active_job.delete(:custom_serializers)
ActiveJob::Serializers.add_serializers custom_serializers
end
end
initializer "active_job.set_configs" do |app|
options = app.config.active_job
options.queue_adapter ||= :async
custom_serializers = options.delete(:custom_serializers)
ActiveJob::Serializers.add_serializers custom_serializers
ActiveSupport.on_load(:active_job) do
options.each { |k, v| send("#{k}=", v) }
options.each do |k, v|
k = "#{k}="
send(k, v) if respond_to? k
end
end
ActiveSupport.on_load(:action_dispatch_integration_test) do
include ActiveJob::TestHelper
end
end
ActiveSupport.on_load(:active_record) do
self.destroy_association_async_job = ActiveRecord::DestroyAssociationAsyncJob

View file

@ -2379,17 +2379,6 @@ module ApplicationTests
assert_equal "async", ActionView::Helpers::AssetTagHelper.image_decoding
end
test "raises when unknown configuration option is set for ActiveJob" do
add_to_config <<-RUBY
config.active_job.unknown = "test"
RUBY
assert_raise(NoMethodError) do
app "development"
ActiveJob::Base # load active_job
end
end
test "ActiveJob::Base.retry_jitter is 0.15 by default for new apps" do
app "development"