aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-05-16 11:17:04 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-05-16 11:17:04 -0700
commitaa964204b867b3e69c1e68fbaec101ce9cbaa0ef (patch)
tree9d76a484b2446a8af531ef40b0f460eb10dd6d52 /activerecord/test/cases
parente29626901ad82bafeb7ade13c3681aa777d7fe2a (diff)
parentc90f16da626a7edac45f7027b127ad874619455a (diff)
downloadrails-aa964204b867b3e69c1e68fbaec101ce9cbaa0ef.tar.gz
rails-aa964204b867b3e69c1e68fbaec101ce9cbaa0ef.tar.bz2
rails-aa964204b867b3e69c1e68fbaec101ce9cbaa0ef.zip
Merge pull request #6336 from erichmenge/patch-pluck-fragment
Fixes issue where SQL fragments prevented type casting based on column
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/calculations_test.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb
index c9a70bae77..f8bd11e3d0 100644
--- a/activerecord/test/cases/calculations_test.rb
+++ b/activerecord/test/cases/calculations_test.rb
@@ -468,6 +468,9 @@ class CalculationsTest < ActiveRecord::TestCase
def test_pluck_with_selection_clause
assert_equal [50, 53, 55, 60], Account.pluck('DISTINCT credit_limit').sort
+ assert_equal [50, 53, 55, 60], Account.pluck('DISTINCT accounts.credit_limit').sort
+ assert_equal [50, 53, 55, 60], Account.pluck('DISTINCT(credit_limit)').sort
+ assert_equal [50 + 53 + 55 + 60], Account.pluck('SUM(DISTINCT(credit_limit))')
end
def test_pluck_expects_a_single_selection