Skip to content

Commit dd35b06

Browse files
committed
Fix eager loading tests
1 parent b800805 commit dd35b06

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/active_record/connection_adapters/sqlserver/schema_statements.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ def columns_for_distinct(columns, orders)
246246
s.gsub(/\s+(?:ASC|DESC)\b/i, '')
247247
.gsub(/\s+NULLS\s+(?:FIRST|LAST)\b/i, '')
248248
}.reject(&:blank?).map.with_index { |column, i| "#{column} AS alias_#{i}" }
249-
[super, *order_columns].join(', ')
249+
250+
(order_columns << super).join(", ")
250251
end
251252

252253
def update_table_definition(table_name, base)

test/cases/coerced_tests.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ def test_a_bad_type_column_coerced
534534
coerce_tests! :test_eager_load_belongs_to_primary_key_quoting
535535
def test_eager_load_belongs_to_primary_key_quoting_coerced
536536
con = Account.connection
537-
assert_sql(/\[companies\]\.\[id\] = 1/) do
537+
assert_sql(/\[companies\]\.\[id\] = @0.* @0 = 1/) do
538538
Account.all.merge!(:includes => :firm).find(1)
539539
end
540540
end

0 commit comments

Comments
 (0)