1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove deprecated ActiveRecord::Base#update_attributes and ActiveRecord::Base#update_attributes!

This commit is contained in:
Rafael Mendonça França 2020-05-07 14:36:23 -04:00
parent 43591b43a6
commit b232d019a2
No known key found for this signature in database
GPG key ID: FC23B6D0F1EEE948
4 changed files with 6 additions and 20 deletions

View file

@ -1,3 +1,7 @@
* Remove deprecated `ActiveRecord::Base#update_attributes` and `ActiveRecord::Base#update_attributes!`.
*Rafael Mendonça França*
* Remove deprecated `migrations_path` argument in `ActiveRecord::ConnectionAdapter::SchemaStatements#assume_migrated_upto_version`.
*Rafael Mendonça França*

View file

@ -629,9 +629,6 @@ module ActiveRecord
end
end
alias update_attributes update
deprecate update_attributes: "please, use update instead"
# Updates its receiver just like #update but calls #save! instead
# of +save+, so an exception is raised if the record is invalid and saving will fail.
def update!(attributes)
@ -643,9 +640,6 @@ module ActiveRecord
end
end
alias update_attributes! update!
deprecate update_attributes!: "please, use update! instead"
# Equivalent to <code>update_columns(name => value)</code>.
def update_column(name, value)
update_columns(name => value)

View file

@ -876,13 +876,6 @@ class PersistenceTest < ActiveRecord::TestCase
assert_equal topic.title, Topic.find(1234).title
end
def test_update_attributes
topic = Topic.find(1)
assert_deprecated do
topic.update_attributes("title" => "The First Topic Updated")
end
end
def test_update_parameters
topic = Topic.find(1)
assert_nothing_raised do
@ -915,13 +908,6 @@ class PersistenceTest < ActiveRecord::TestCase
Reply.clear_validators!
end
def test_update_attributes!
reply = Reply.find(2)
assert_deprecated do
reply.update_attributes!("title" => "The Second Topic of the day updated")
end
end
def test_destroyed_returns_boolean
developer = Developer.first
assert_equal false, developer.destroyed?

View file

@ -149,6 +149,8 @@ Please refer to the [Changelog][active-record] for detailed changes.
### Removals
* Remove deprecated `ActiveRecord::Base#update_attributes` and `ActiveRecord::Base#update_attributes!`.
* Remove deprecated `migrations_path` argument in
`ActiveRecord::ConnectionAdapter::SchemaStatements#assume_migrated_upto_version`.