aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-07-16 20:26:10 +0000
committerRick Olson <technoweenie@gmail.com>2007-07-16 20:26:10 +0000
commit872c5f4380ca348ff9ed19963e827289fb831fdf (patch)
tree47f486fb23a24dfaba9b16cf6c87d16d751c8f52 /activerecord/test
parent4ef5af8d4ddad82295920cc7d83fba6cbb10ad71 (diff)
downloadrails-872c5f4380ca348ff9ed19963e827289fb831fdf.tar.gz
rails-872c5f4380ca348ff9ed19963e827289fb831fdf.tar.bz2
rails-872c5f4380ca348ff9ed19963e827289fb831fdf.zip
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
Diffstat (limited to 'activerecord/test')
-rwxr-xr-xactiverecord/test/associations_test.rb4
-rwxr-xr-xactiverecord/test/base_test.rb7
-rw-r--r--activerecord/test/calculations_test.rb4
3 files changed, 3 insertions, 12 deletions
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