Skip to content

Commit ca76dc0

Browse files
committed
Correctly set SQL if no returning columns
Fixes "EagerAssociationTest::test_string_id_column_joins" test.
1 parent 8cd903b commit ca76dc0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/active_record/connection_adapters/sqlserver/database_statements.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ def sql_for_insert(sql, pk, binds, returning)
304304
if returning_columns.any?
305305
returning_columns_statements = returning_columns.map { |c| " INSERTED.#{SQLServer::Utils.extract_identifiers(c).quoted}" }
306306
sql.dup.insert sql.index(/ (DEFAULT )?VALUES/i), " OUTPUT" + returning_columns_statements.join(",")
307+
else
308+
sql
307309
end
308310
end
309311
else

0 commit comments

Comments
 (0)