aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relations_test.rb
diff options
context:
space:
mode:
authorWojciech Wnętrzak <w.wnetrzak@gmail.com>2015-09-05 10:50:05 +0200
committerWojciech Wnętrzak <w.wnetrzak@gmail.com>2015-09-06 16:14:16 +0200
commitc82c5f8ffd7291186235c5912151c9dc0d262c4a (patch)
treee881e9d357f4368158e03724cb241265c717f8ae /activerecord/test/cases/relations_test.rb
parenta8f4568f5396b68ae81eddc636604bb78bb6632a (diff)
downloadrails-c82c5f8ffd7291186235c5912151c9dc0d262c4a.tar.gz
rails-c82c5f8ffd7291186235c5912151c9dc0d262c4a.tar.bz2
rails-c82c5f8ffd7291186235c5912151c9dc0d262c4a.zip
Deprecate passing conditions to AR::Relation destroy_all and delete_all methods
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r--activerecord/test/cases/relations_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 5f48c2b40f..8256762f96 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -931,6 +931,12 @@ class RelationTest < ActiveRecord::TestCase
assert davids.loaded?
end
+ def test_destroy_all_with_conditions_is_deprecated
+ assert_deprecated do
+ assert_difference('Author.count', -1) { Author.destroy_all(name: 'David') }
+ end
+ end
+
def test_delete_all
davids = Author.where(:name => 'David')
@@ -938,6 +944,12 @@ class RelationTest < ActiveRecord::TestCase
assert ! davids.loaded?
end
+ def test_delete_all_with_conditions_is_deprecated
+ assert_deprecated do
+ assert_difference('Author.count', -1) { Author.delete_all(name: 'David') }
+ end
+ end
+
def test_delete_all_loaded
davids = Author.where(:name => 'David')