Skip to content

Commit 3dec3c8

Browse files
committed
Check if Arel BindParam is passed
1 parent 8978e0e commit 3dec3c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/active_record/connection_adapters/sqlserver/database_statements.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ def sp_executesql(sql, name, binds, options = {})
237237
def sp_executesql_types_and_parameters(binds)
238238
types, params = [], []
239239
binds.each_with_index do |attr, index|
240+
if attr.is_a?(Arel::Nodes::BindParam)
241+
attr = attr.value
242+
end
243+
240244
types << "@#{index} #{sp_executesql_sql_type(attr)}"
241245
params << sp_executesql_sql_param(attr)
242246
end

0 commit comments

Comments
 (0)