mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
parent
39542fba54
commit
6cb956592c
1 changed files with 7 additions and 0 deletions
|
@ -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!
|
||||
|
|
Loading…
Reference in a new issue