From ea759cb76161a7a0003c3cd3b38a8a125a99af3c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 7 Dec 2004 12:25:01 +0000 Subject: Added counter_sql option for has_many associations [bitsweat] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@68 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/associations_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/test/associations_test.rb') diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index 3325c10eda..cc4c2374d1 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -178,6 +178,11 @@ class HasManyAssociationsTest < Test::Unit::TestCase assert_equal 1, Firm.find_first.clients_using_sql.size end + def test_counting_using_sql + assert_equal 1, Firm.find_first.clients_using_counter_sql.size + assert_equal 0, Firm.find_first.clients_using_zero_counter_sql.size + end + def test_find_all assert_equal 2, Firm.find_first.clients.find_all("type = 'Client'").length assert_equal 1, Firm.find_first.clients.find_all("name = 'Summit'").length -- cgit v1.2.3