From 85f3a57a57b3c6d105e35936bf3ee972dc652902 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 11 Apr 2014 16:14:51 -0700 Subject: propogate bind values collected in arel to SQL generation --- activerecord/test/cases/relations_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/test/cases/relations_test.rb') diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 662e374ddd..dc196f4432 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -864,6 +864,14 @@ class RelationTest < ActiveRecord::TestCase assert_equal 11, posts.distinct(false).select(:comments_count).count end + def test_update_all_with_scope + tag = Tag.first + Post.tagged_with(tag.id).update_all title: "rofl" + list = Post.tagged_with(tag.id).all.to_a + assert_operator list.length, :>, 0 + list.each { |post| assert_equal 'rofl', post.title } + end + def test_count_explicit_columns Post.update_all(:comments_count => nil) posts = Post.all -- cgit v1.2.3