File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
lib/active_record/connection_adapters/sqlserver Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -321,10 +321,13 @@ def sp_executesql_types_and_parameters(binds)
321
321
322
322
def sp_executesql_sql_type ( attr )
323
323
if attr . respond_to? ( :type )
324
- return attr . type . sqlserver_type if attr . type . respond_to? ( :sqlserver_type )
324
+ type = attr . type . is_a? ( ActiveRecord ::Normalization ::NormalizedValueType ) ? attr . type . cast_type : attr . type
325
+ type = type . subtype if type . serialized?
325
326
326
- if attr . type . is_a? ( ActiveRecord ::Encryption ::EncryptedAttributeType ) && attr . type . instance_variable_get ( :@cast_type ) . respond_to? ( :sqlserver_type )
327
- return attr . type . instance_variable_get ( :@cast_type ) . sqlserver_type
327
+ return type . sqlserver_type if type . respond_to? ( :sqlserver_type )
328
+
329
+ if type . is_a? ( ActiveRecord ::Encryption ::EncryptedAttributeType ) && type . instance_variable_get ( :@cast_type ) . respond_to? ( :sqlserver_type )
330
+ return type . instance_variable_get ( :@cast_type ) . sqlserver_type
328
331
end
329
332
end
330
333
You can’t perform that action at this time.
0 commit comments