1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add test case for joined pluck

39542fba54 (commitcomment-8938379)
This commit is contained in:
Sean Griffin 2014-12-11 14:54:03 -07:00
parent 39542fba54
commit 6cb956592c

View file

@ -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!