File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
railties/test/application Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class Railtie < Rails::Railtie # :nodoc:
43
43
end
44
44
45
45
ActiveSupport . on_load ( :active_record ) do
46
- self . destroy_association_async_job = ActiveRecord ::DestroyAssociationAsyncJob
46
+ self . destroy_association_async_job || = ActiveRecord ::DestroyAssociationAsyncJob
47
47
end
48
48
end
49
49
Original file line number Diff line number Diff line change
1
+ * Fix ` config.active_record.destroy_association_async_job ` configuration
2
+
3
+ ` config.active_record.destroy_association_async_job ` should allow
4
+ applications to specify the job that will be used to destroy associated
5
+ records in the background for ` has_many ` associations with the
6
+ ` dependent: :destroy_async ` option. Previously, that was ignored, which
7
+ meant the default ` ActiveRecord::DestroyAssociationAsyncJob ` always
8
+ destroyed records in the background.
9
+
10
+ * Nick Holden*
11
+
1
12
* Fix quoting of ` ActiveSupport::Duration ` and ` Rational ` numbers in the MySQL adapter.
2
13
3
14
* Kevin McPhillips*
Original file line number Diff line number Diff line change @@ -2444,6 +2444,20 @@ class ::DummySerializer < ActiveJob::Serializers::ObjectSerializer; end
2444
2444
assert_equal ActiveRecord ::DestroyAssociationAsyncJob , ActiveRecord ::Base . destroy_association_async_job
2445
2445
end
2446
2446
2447
+ test "ActiveRecord::Base.destroy_association_async_job can be configured via config.active_record.destroy_association_job" do
2448
+ class ::DummyDestroyAssociationAsyncJob ; end
2449
+
2450
+ app_file "config/environments/test.rb" , <<-RUBY
2451
+ Rails.application.configure do
2452
+ config.active_record.destroy_association_async_job = DummyDestroyAssociationAsyncJob
2453
+ end
2454
+ RUBY
2455
+
2456
+ app "test"
2457
+
2458
+ assert_equal DummyDestroyAssociationAsyncJob , ActiveRecord ::Base . destroy_association_async_job
2459
+ end
2460
+
2447
2461
test "ActionView::Helpers::FormTagHelper.default_enforce_utf8 is false by default" do
2448
2462
app "development"
2449
2463
assert_equal false , ActionView ::Helpers ::FormTagHelper . default_enforce_utf8
You can’t perform that action at this time.
0 commit comments