diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-03-19 17:42:51 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-03-19 17:42:51 +0000 |
commit | 753010ac39f5442c92ec0bdd7484f0fd72ad8ac0 (patch) | |
tree | 6094ded6eee2fcf349f980de96429333b1ff7cbb /activerecord/test/base_test.rb | |
parent | 8196e8e72315386b44f38f9f893a960235114bdf (diff) | |
download | rails-753010ac39f5442c92ec0bdd7484f0fd72ad8ac0.tar.gz rails-753010ac39f5442c92ec0bdd7484f0fd72ad8ac0.tar.bz2 rails-753010ac39f5442c92ec0bdd7484f0fd72ad8ac0.zip |
add support for COUNT(DISTINCT id) queries in sqlite2 (closes #4300) [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3979 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/base_test.rb')
-rwxr-xr-x | activerecord/test/base_test.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index d35f876002..35b00b878a 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -1095,9 +1095,7 @@ class BasicsTest < Test::Unit::TestCase assert_equal res4, res5 - unless ActiveRecord::Base.connection.raw_connection.class.name == 'SQLite::Database' - res6 = Post.count_by_sql "SELECT COUNT(DISTINCT p.id) FROM posts p, comments c WHERE p.#{QUOTED_TYPE} = 'Post' AND p.id=c.post_id" - end + res6 = Post.count_by_sql "SELECT COUNT(DISTINCT p.id) FROM posts p, comments c WHERE p.#{QUOTED_TYPE} = 'Post' AND p.id=c.post_id" res7 = nil assert_nothing_raised do res7 = Post.count(:conditions => "p.#{QUOTED_TYPE} = 'Post' AND p.id=c.post_id", |