@@ -337,28 +337,33 @@ def find_by!(*args) # :nodoc:
337
337
find_by ( *args ) || raise ( RecordNotFound . new ( "Couldn't find #{ name } " , name ) )
338
338
end
339
339
340
- def default_timezone # :nodoc:
341
- ActiveRecord . default_timezone
342
- end
343
-
344
340
def maintain_test_schema # :nodoc:
345
341
ActiveRecord . maintain_test_schema
346
342
end
347
343
348
- def reading_role # :nodoc:
349
- ActiveSupport ::Deprecation . warn ( <<~MSG )
350
- ActiveRecord::Base.reading_role is deprecated and will be removed in Rails 7.1.
351
- Use `ActiveRecord.reading_role` instead.
352
- MSG
353
- ActiveRecord . reading_role
354
- end
344
+ %w(
345
+ reading_role writing_role legacy_connection_handling default_timezone index_nested_attribute_errors
346
+ verbose_query_logs queues maintain_test_schema warn_on_records_fetched_greater_than
347
+ application_record_class action_on_strict_loading_violation schema_format error_on_ignored_order
348
+ timestamped_migrations dump_schema_after_migration dump_schemas suppress_multiple_database_warning
349
+ ) . each do |attr |
350
+ module_eval ( <<~RUBY , __FILE__ , __LINE__ + 1 )
351
+ def #{ attr }
352
+ ActiveSupport::Deprecation.warn(<<~MSG)
353
+ ActiveRecord::Base.#{ attr } is deprecated and will be removed in Rails 7.1.
354
+ Use `ActiveRecord.#{ attr } ` instead.
355
+ MSG
356
+ ActiveRecord.#{ attr }
357
+ end
355
358
356
- def writing_role # :nodoc:
357
- ActiveSupport ::Deprecation . warn ( <<~MSG )
358
- ActiveRecord::Base.writing_role is deprecated and will be removed in Rails 7.1.
359
- Use `ActiveRecord.writing_role` instead.
360
- MSG
361
- ActiveRecord . writing_role
359
+ def #{ attr } =(value)
360
+ ActiveSupport::Deprecation.warn(<<~MSG)
361
+ ActiveRecord::Base.#{ attr } = is deprecated and will be removed in Rails 7.1.
362
+ Use `ActiveRecord.#{ attr } =` instead.
363
+ MSG
364
+ ActiveRecord.#{ attr } = value
365
+ end
366
+ RUBY
362
367
end
363
368
364
369
def initialize_generated_modules # :nodoc:
0 commit comments