Skip to content

Commit 5f26c0f

Browse files
committed
Handle normalized types
1 parent 1a2f4dc commit 5f26c0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/active_record/connection_adapters/sqlserver/database_statements.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ def sp_executesql_types_and_parameters(binds)
321321

322322
def sp_executesql_sql_type(attr)
323323
if attr.respond_to?(:type)
324-
type = attr.type.serialized? ? attr.type.subtype : attr.type
324+
type = attr.type.is_a?(ActiveRecord::Normalization::NormalizedValueType) ? attr.type.cast_type : attr.type
325+
type = type.subtype if type.serialized?
325326

326327
return type.sqlserver_type if type.respond_to?(:sqlserver_type)
327328

0 commit comments

Comments
 (0)