File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
activerecord/lib/active_record Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,10 @@ def default_timezone # :nodoc:
341
341
ActiveRecord . default_timezone
342
342
end
343
343
344
+ def maintain_test_schema # :nodoc:
345
+ ActiveRecord . maintain_test_schema
346
+ end
347
+
344
348
def reading_role # :nodoc:
345
349
ActiveSupport ::Deprecation . warn ( <<~MSG )
346
350
ActiveRecord::Base.reading_role is deprecated and will be removed in Rails 7.0.
Original file line number Diff line number Diff line change @@ -651,7 +651,7 @@ def load_schema_if_pending!
651
651
end
652
652
653
653
def maintain_test_schema! #:nodoc:
654
- if ActiveRecord . maintain_test_schema
654
+ if ActiveRecord :: Base . maintain_test_schema
655
655
suppress_messages { load_schema_if_pending! }
656
656
end
657
657
end
Original file line number Diff line number Diff line change @@ -224,8 +224,15 @@ class Railtie < Rails::Railtie # :nodoc:
224
224
configs . each do |k , v |
225
225
next if k == :encryption
226
226
setter = "#{ k } ="
227
- next if ActiveRecord . respond_to? ( setter )
228
- send ( setter , v )
227
+ # Some existing initializers might rely on Active Record configuration
228
+ # being copied from the config object to their actual destination when
229
+ # `ActiveRecord::Base` is loaded.
230
+ # So to preserve backward compatibility we copy the config a second time.
231
+ if ActiveRecord . respond_to? ( setter )
232
+ ActiveRecord . send ( setter , v )
233
+ else
234
+ send ( setter , v )
235
+ end
229
236
end
230
237
end
231
238
end
You can’t perform that action at this time.
0 commit comments