From a111944e4b89910d48081f532626f0973ec92346 Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Thu, 20 Jan 2022 18:27:19 +0900 Subject: [PATCH] Merge pull request #2249 from swamp09/fix_columns_for_distinct --- .../connection_adapters/oracle_enhanced_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb index 177374dc0..0d66b3f66 100644 --- a/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb +++ b/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb @@ -661,7 +661,7 @@ def columns_for_distinct(columns, orders) #:nodoc: }.reject(&:blank?).map.with_index { |column, i| "FIRST_VALUE(#{column}) OVER (PARTITION BY #{columns} ORDER BY #{column}) AS alias_#{i}__" } - [super, *order_columns].join(", ") + (order_columns << super).join(", ") end def temporary_table?(table_name) #:nodoc: