aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/calculations_test.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-04-04 12:06:22 +0000
committerMichael Koziarski <michael@koziarski.com>2008-04-04 12:06:22 +0000
commit50538fb524950798cd8896f693909bdbc620bd8e (patch)
tree56c4f4bc9c4db0c79b5a362e796535d2022b6b8c /activerecord/test/cases/calculations_test.rb
parent295587f0ab3cdaa1875827a3c2e6a6686eac6ab2 (diff)
downloadrails-50538fb524950798cd8896f693909bdbc620bd8e.tar.gz
rails-50538fb524950798cd8896f693909bdbc620bd8e.tar.bz2
rails-50538fb524950798cd8896f693909bdbc620bd8e.zip
Don't double include DISTINCT when the user has already specified it. Closes #11502 [kenneth.kalmer]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9223 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/cases/calculations_test.rb')
-rw-r--r--activerecord/test/cases/calculations_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb
index 1771065a66..0ed40b469d 100644
--- a/activerecord/test/cases/calculations_test.rb
+++ b/activerecord/test/cases/calculations_test.rb
@@ -241,6 +241,10 @@ class CalculationsTest < ActiveRecord::TestCase
assert_equal 4, Account.count(:distinct => true, :include => :firm, :select => :credit_limit)
end
+ def test_should_count_manual_select_with_include
+ assert_equal 6, Account.count(:select => "DISTINCT accounts.id", :include => :firm)
+ end
+
def test_count_with_column_parameter
assert_equal 5, Account.count(:firm_id)
end