Skip to content

Commit 06989cc

Browse files
committed
Allow place-holder condition to be a query parameter
1 parent 6101432 commit 06989cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/active_record/connection_adapters/sqlserver/database_statements.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def sp_executesql_types_and_parameters(binds)
325325
end
326326

327327
def sp_executesql_sql_type(attr)
328-
return "nvarchar(max)".freeze if attr.is_a?(Symbol)
328+
return "nvarchar(max)".freeze if attr.is_a?(Symbol) || attr.is_a?(String)
329329
return attr.type.sqlserver_type if attr.type.respond_to?(:sqlserver_type)
330330

331331
case value = attr.value_for_database
@@ -337,7 +337,7 @@ def sp_executesql_sql_type(attr)
337337
end
338338

339339
def sp_executesql_sql_param(attr)
340-
return quote(attr) if attr.is_a?(Symbol)
340+
return quote(attr) if attr.is_a?(Symbol) || attr.is_a?(String)
341341

342342
case value = attr.value_for_database
343343
when Type::Binary::Data,

0 commit comments

Comments
 (0)