aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRoman Shatsov <roshats@gmail.com>2012-07-23 11:33:21 +0300
committerRoman Shatsov <roshats@gmail.com>2012-08-14 21:04:48 +0300
commitf28096476dee5c7d5af037e4cdf06b339fe4778a (patch)
treedefee001d3a44a5b4a95dae407802af585d71acb /activerecord/test
parent580fa0c7be62868ff521570d37094e22ffa81f00 (diff)
downloadrails-f28096476dee5c7d5af037e4cdf06b339fe4778a.tar.gz
rails-f28096476dee5c7d5af037e4cdf06b339fe4778a.tar.bz2
rails-f28096476dee5c7d5af037e4cdf06b339fe4778a.zip
raise ArgumentError if list of attributes to change is empty in update_all
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relations_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index c8da7ddd99..4c5e8aaa1c 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -1122,6 +1122,10 @@ class RelationTest < ActiveRecord::TestCase
assert_equal authors(:david), Author.order('id DESC , name DESC').last
end
+ def test_update_all_with_blank_argument
+ assert_raises(ArgumentError) { Comment.update_all({}) }
+ end
+
def test_update_all_with_joins
comments = Comment.joins(:post).where('posts.id' => posts(:welcome).id)
count = comments.count