From f28096476dee5c7d5af037e4cdf06b339fe4778a Mon Sep 17 00:00:00 2001 From: Roman Shatsov Date: Mon, 23 Jul 2012 11:33:21 +0300 Subject: raise ArgumentError if list of attributes to change is empty in update_all --- activerecord/test/cases/relations_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/test/cases') 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 -- cgit v1.2.3