Skip to content

Commit 766b84d

Browse files
authored
Merge pull request rails#43371 from rails/fix_postgresql_14_tests
Specify ORDER BY enumsortorder for postgres enums
2 parents 7600f6a + 9b73129 commit 766b84d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def enum_types
459459
query = <<~SQL
460460
SELECT
461461
type.typname AS name,
462-
string_agg(enum.enumlabel, ',') AS value
462+
string_agg(enum.enumlabel, ',' ORDER BY enum.enumsortorder) AS value
463463
FROM pg_enum AS enum
464464
JOIN pg_type AS type
465465
ON (type.oid = enum.enumtypid)

0 commit comments

Comments
 (0)