Remove deprecated ActiveRecord::Base config accessors

This commit is contained in:
Rafael Mendonça França 2023-01-16 23:37:40 +00:00
parent 696ccbc265
commit 96c9db1b48
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
3 changed files with 8 additions and 27 deletions

@ -1,3 +1,7 @@
* Remove deprecated `ActiveRecord::Base` config accessors.
*Rafael Mendonça França*
* Remove the `:include_replicas` argument from `configs_for`. Use `:include_hidden` argument instead.
*Eileen M. Uchitelle*
@ -138,7 +142,7 @@
*Matthew Draper*, *Ole Friis*
* `ActiveRecord::Base#signed_id` raises if called on a new record
* `ActiveRecord::Base#signed_id` raises if called on a new record.
Previously it would return an ID that was not usable, since it was based on `id = nil`.

@ -288,31 +288,6 @@ def find_by!(*args) # :nodoc:
find_by(*args) || where(*args).raise_record_not_found_exception!
end
%w(
reading_role writing_role default_timezone index_nested_attribute_errors
verbose_query_logs queues warn_on_records_fetched_greater_than maintain_test_schema
application_record_class action_on_strict_loading_violation schema_format error_on_ignored_order
timestamped_migrations dump_schema_after_migration dump_schemas suppress_multiple_database_warning
).each do |attr|
module_eval(<<~RUBY, __FILE__, __LINE__ + 1)
def #{attr}
ActiveRecord.deprecator.warn(<<~MSG)
ActiveRecord::Base.#{attr} is deprecated and will be removed in Rails 7.1.
Use `ActiveRecord.#{attr}` instead.
MSG
ActiveRecord.#{attr}
end
def #{attr}=(value)
ActiveRecord.deprecator.warn(<<~MSG)
ActiveRecord::Base.#{attr}= is deprecated and will be removed in Rails 7.1.
Use `ActiveRecord.#{attr}=` instead.
MSG
ActiveRecord.#{attr} = value
end
RUBY
end
def initialize_generated_modules # :nodoc:
generated_association_methods
end

@ -95,7 +95,9 @@ Please refer to the [Changelog][active-record] for detailed changes.
### Removals
* Remove support for `ActiveRecord.legacy_connection_handling`.
* Remove support for `ActiveRecord.legacy_connection_handling`.
* Remove deprecated `ActiveRecord::Base` config accessors
* Remove support for `:include_replicas` on `configs_for`. Use `:include_hidden` instead.