From 6cb956592cc5deb5496729f1e09ca9a4cc22868c Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Thu, 11 Dec 2014 14:54:03 -0700 Subject: Add test case for joined pluck https://github.com/rails/rails/commit/39542fba54328ca048fb75a5d5b37f8e1d4c1f37#commitcomment-8938379 --- activerecord/test/cases/calculations_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activerecord') diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index 6cf18bc3c6..299217214e 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -618,6 +618,13 @@ class CalculationsTest < ActiveRecord::TestCase assert_equal part.id, ShipPart.joins(:trinkets).sum(:id) end + def test_pluck_joined_with_polymorphic_relation + part = ShipPart.create!(name: "has trinket") + part.trinkets.create! + + assert_equal [part.id], ShipPart.joins(:trinkets).pluck(:id) + end + def test_grouped_calculation_with_polymorphic_relation part = ShipPart.create!(name: "has trinket") part.trinkets.create! -- cgit v1.2.3