From 609ca177fa66ab0fbe19dd0cdcd7d8f1576cd9da Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 2 Jan 2005 18:44:55 +0000 Subject: Added HasManyAssociation#count that works like Base#count #413 [intinig] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@318 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/associations_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index f94f04e279..844f075f34 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -149,6 +149,10 @@ class HasManyAssociationsTest < Test::Unit::TestCase @signals37.clients_of_firm.each {|f| } end + def test_counting + assert_equal 2, Firm.find_first.clients.count + end + def test_finding assert_equal 2, Firm.find_first.clients.length end -- cgit v1.2.3