From 872c5f4380ca348ff9ed19963e827289fb831fdf Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Mon, 16 Jul 2007 20:26:10 +0000 Subject: Remove deprecated count(conditions=nil, joins=nil) usage. Closes #8993 [lifofifo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7189 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/associations_test.rb | 4 +--- activerecord/test/base_test.rb | 7 ++----- activerecord/test/calculations_test.rb | 4 ---- 3 files changed, 3 insertions(+), 12 deletions(-) (limited to 'activerecord/test') diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index 0db8d91099..607f12bdb5 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -433,9 +433,7 @@ class HasManyAssociationsTest < Test::Unit::TestCase end def test_counting_with_single_conditions - assert_deprecated 'count' do - assert_equal 2, Firm.find(:first).plain_clients.count('1=1') - end + assert_equal 2, Firm.find(:first).plain_clients.count(:conditions => '1=1') end def test_counting_with_single_hash diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 5a224bfbb8..2851665345 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -1330,11 +1330,8 @@ class BasicsTest < Test::Unit::TestCase def test_count_with_join res = Post.count_by_sql "SELECT COUNT(*) FROM posts LEFT JOIN comments ON posts.id=comments.post_id WHERE posts.#{QUOTED_TYPE} = 'Post'" - res2 = nil - assert_deprecated 'count' do - res2 = Post.count("posts.#{QUOTED_TYPE} = 'Post'", - "LEFT JOIN comments ON posts.id=comments.post_id") - end + + res2 = Post.count(:conditions => "posts.#{QUOTED_TYPE} = 'Post'", :joins => "LEFT JOIN comments ON posts.id=comments.post_id") assert_equal res, res2 res3 = nil diff --git a/activerecord/test/calculations_test.rb b/activerecord/test/calculations_test.rb index bf34beb702..faa86c43f2 100644 --- a/activerecord/test/calculations_test.rb +++ b/activerecord/test/calculations_test.rb @@ -233,10 +233,6 @@ class CalculationsTest < Test::Unit::TestCase assert_equal 4, Account.count(:distinct => true, :include => :firm, :select => :credit_limit) end - def test_deprecated_count_with_string_parameters - assert_deprecated('count') { Account.count('credit_limit > 50') } - end - def test_count_with_no_parameters_isnt_deprecated assert_not_deprecated { Account.count } end -- cgit v1.2.3