Skip to content

Commit e6d924e

Browse files
jdlubranorafaelfranca
authored andcommitted
Add configuration test for ActiveRecord being loaded prior to new framework defaults
1 parent 247f71b commit e6d924e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

railties/test/application/configuration_test.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4482,6 +4482,20 @@ def new(app); self; end
44824482
assert_equal true, ActiveRecord.run_after_transaction_callbacks_in_order_defined
44834483
end
44844484

4485+
test "run_after_transaction_callbacks_in_order_defined can be set via framework defaults even if Active Record was previously loaded" do
4486+
remove_from_config '.*config\.load_defaults.*\n'
4487+
add_to_config 'config.load_defaults "7.0"'
4488+
app_file "config/initializers/01_configure_database.rb", <<-RUBY
4489+
ActiveRecord::Base.connected?
4490+
RUBY
4491+
app_file "config/initializers/new_framework_defaults_7_1.rb", <<-RUBY
4492+
Rails.application.config.active_record.run_after_transaction_callbacks_in_order_defined = true
4493+
RUBY
4494+
app "development"
4495+
4496+
assert_equal true, ActiveRecord.run_after_transaction_callbacks_in_order_defined
4497+
end
4498+
44854499
test "raises if configuration tries to assign to an actual method" do
44864500
remove_from_config '.*config\.load_defaults.*\n'
44874501
add_to_config 'config.load_defaults = "7.0"'

0 commit comments

Comments
 (0)