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:
parent
43591b43a6
commit
b232d019a2
4 changed files with 6 additions and 20 deletions
|
@ -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*
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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`.
|
||||
|
||||
|
|
Loading…
Reference in a new issue