Skip to content

Commit a35074e

Browse files
Fix test_pluck_functions_without_alias
1 parent d7c02de commit a35074e

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

activerecord/test/cases/calculations_test.rb

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,22 +1228,13 @@ def test_pluck_functions_with_alias
12281228
end
12291229

12301230
def test_pluck_functions_without_alias
1231-
expected = if current_adapter?(:PostgreSQLAdapter)
1232-
# PostgreSQL returns the same name for each column in the given query, so each column is named "coalesce"
1233-
# As a result Rails cannot accurately type cast each value.
1234-
# To work around this, you should use aliases in your select statement (see test_pluck_functions_with_alias).
1235-
[
1236-
["1", "The First Topic"], ["2", "The Second Topic of the day"],
1237-
["3", "The Third Topic of the day"], ["4", "The Fourth Topic of the day"],
1238-
["5", "The Fifth Topic of the day"]
1239-
]
1240-
else
1241-
[
1242-
[1, "The First Topic"], [2, "The Second Topic of the day"],
1243-
[3, "The Third Topic of the day"], [4, "The Fourth Topic of the day"],
1244-
[5, "The Fifth Topic of the day"]
1245-
]
1246-
end
1231+
expected = [
1232+
[1, "The First Topic"],
1233+
[2, "The Second Topic of the day"],
1234+
[3, "The Third Topic of the day"],
1235+
[4, "The Fourth Topic of the day"],
1236+
[5, "The Fifth Topic of the day"]
1237+
]
12471238

12481239
assert_equal expected, Topic.order(:id).pluck(
12491240
Arel.sql("COALESCE(id, 0)"),

0 commit comments

Comments
 (0)