Skip to content

Commit 3780c13

Browse files
committed
Exercise test for pluck with hash values
1 parent 99a6365 commit 3780c13

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

activerecord/test/cases/calculations_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,10 +1144,12 @@ def test_pluck_with_includes_offset
11441144
end
11451145

11461146
def test_pluck_with_join
1147+
assert_equal [[2, 2], [4, 4]], Reply.includes(:topic).order(:id).pluck(:id, topics: [:id])
11471148
assert_equal [[2, 2], [4, 4]], Reply.includes(:topic).order(:id).pluck(:id, :"topics.id")
11481149
end
11491150

11501151
def test_pluck_with_join_alias
1152+
assert_equal [[2, 1], [4, 3]], Reply.includes(:topic).order(:id).pluck(:id, topic: [:id])
11511153
assert_equal [[2, 1], [4, 3]], Reply.includes(:topic).order(:id).pluck(:id, :"topic.id")
11521154
end
11531155

0 commit comments

Comments
 (0)