Remove deprecated `ActiveRecord::Base#update_attributes` and `ActiveRecord::Base#update_attributes!`
This commit is contained in:
parent
43591b43a6
commit
b232d019a2
|
@ -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`.
|
* Remove deprecated `migrations_path` argument in `ActiveRecord::ConnectionAdapter::SchemaStatements#assume_migrated_upto_version`.
|
||||||
|
|
||||||
*Rafael Mendonça França*
|
*Rafael Mendonça França*
|
||||||
|
|
|
@ -629,9 +629,6 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
alias update_attributes update
|
|
||||||
deprecate update_attributes: "please, use update instead"
|
|
||||||
|
|
||||||
# Updates its receiver just like #update but calls #save! 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.
|
# of +save+, so an exception is raised if the record is invalid and saving will fail.
|
||||||
def update!(attributes)
|
def update!(attributes)
|
||||||
|
@ -643,9 +640,6 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
alias update_attributes! update!
|
|
||||||
deprecate update_attributes!: "please, use update! instead"
|
|
||||||
|
|
||||||
# Equivalent to <code>update_columns(name => value)</code>.
|
# Equivalent to <code>update_columns(name => value)</code>.
|
||||||
def update_column(name, value)
|
def update_column(name, value)
|
||||||
update_columns(name => value)
|
update_columns(name => value)
|
||||||
|
|
|
@ -876,13 +876,6 @@ class PersistenceTest < ActiveRecord::TestCase
|
||||||
assert_equal topic.title, Topic.find(1234).title
|
assert_equal topic.title, Topic.find(1234).title
|
||||||
end
|
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
|
def test_update_parameters
|
||||||
topic = Topic.find(1)
|
topic = Topic.find(1)
|
||||||
assert_nothing_raised do
|
assert_nothing_raised do
|
||||||
|
@ -915,13 +908,6 @@ class PersistenceTest < ActiveRecord::TestCase
|
||||||
Reply.clear_validators!
|
Reply.clear_validators!
|
||||||
end
|
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
|
def test_destroyed_returns_boolean
|
||||||
developer = Developer.first
|
developer = Developer.first
|
||||||
assert_equal false, developer.destroyed?
|
assert_equal false, developer.destroyed?
|
||||||
|
|
|
@ -149,6 +149,8 @@ Please refer to the [Changelog][active-record] for detailed changes.
|
||||||
|
|
||||||
### Removals
|
### Removals
|
||||||
|
|
||||||
|
* Remove deprecated `ActiveRecord::Base#update_attributes` and `ActiveRecord::Base#update_attributes!`.
|
||||||
|
|
||||||
* Remove deprecated `migrations_path` argument in
|
* Remove deprecated `migrations_path` argument in
|
||||||
`ActiveRecord::ConnectionAdapter::SchemaStatements#assume_migrated_upto_version`.
|
`ActiveRecord::ConnectionAdapter::SchemaStatements#assume_migrated_upto_version`.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue