Skip to content

Commit

Permalink
Remove deprecated config.active_record.partial_writes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Mar 3, 2023
1 parent 96c9db1 commit 96b9fd6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
4 changes: 4 additions & 0 deletions activerecord/CHANGELOG.md
@@ -1,3 +1,7 @@
* Remove deprecated `config.active_record.partial_writes`.

*Rafael Mendonça França*

* Remove deprecated `ActiveRecord::Base` config accessors.

*Rafael Mendonça França*
Expand Down
26 changes: 0 additions & 26 deletions activerecord/lib/active_record/attribute_methods/dirty.rb
Expand Up @@ -27,32 +27,6 @@ module Dirty
attribute_method_suffix("_change_to_be_saved", "_in_database", parameters: false)
end

module ClassMethods
def partial_writes
ActiveRecord.deprecator.warn(<<-MSG.squish)
ActiveRecord::Base.partial_writes is deprecated and will be removed in Rails 7.1.
Use `partial_updates` and `partial_inserts` instead.
MSG
partial_updates && partial_inserts
end

def partial_writes?
ActiveRecord.deprecator.warn(<<-MSG.squish)
`ActiveRecord::Base.partial_writes?` is deprecated and will be removed in Rails 7.1.
Use `partial_updates?` and `partial_inserts?` instead.
MSG
partial_updates? && partial_inserts?
end

def partial_writes=(value)
ActiveRecord.deprecator.warn(<<-MSG.squish)
`ActiveRecord::Base.partial_writes=` is deprecated and will be removed in Rails 7.1.
Use `partial_updates=` and `partial_inserts=` instead.
MSG
self.partial_updates = self.partial_inserts = value
end
end

# <tt>reload</tt> the record and clears changed attributes.
def reload(*)
super.tap do
Expand Down
2 changes: 2 additions & 0 deletions guides/source/7_1_release_notes.md
Expand Up @@ -101,6 +101,8 @@ Please refer to the [Changelog][active-record] for detailed changes.

* Remove support for `:include_replicas` on `configs_for`. Use `:include_hidden` instead.

* Remove deprecated `config.active_record.partial_writes`.

### Deprecations

### Notable changes
Expand Down

0 comments on commit 96b9fd6

Please sign in to comment.