From c36f8111a6e7f305adc8eac87ea006e2517b93df Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 4 Jan 2008 03:19:50 +0000 Subject: pdate_all ignores scoped :order and :limit, so post.comments.update_all doesn't try to include the comment order in the update statement. Closes #10686. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8554 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/base_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 5f8f1537d9..b140e9ce54 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -596,6 +596,13 @@ class BasicsTest < Test::Unit::TestCase end end + def test_update_all_ignores_order_limit_from_association + author = Author.find(1) + assert_nothing_raised do + assert_equal author.posts_with_comments_and_categories.length, author.posts_with_comments_and_categories.update_all("body = 'bulk update!'") + end + end + def test_update_many topic_data = { 1 => { "content" => "1 updated" }, 2 => { "content" => "2 updated" } } updated = Topic.update(topic_data.keys, topic_data.values) -- cgit v1.2.3