File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
lib/active_record/connection_adapters/sqlserver Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -321,10 +321,12 @@ 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 . serialized? ? attr . type . subtype : attr . type
325
325
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
326
+ return type . sqlserver_type if type . respond_to? ( :sqlserver_type )
327
+
328
+ if type . is_a? ( ActiveRecord ::Encryption ::EncryptedAttributeType ) && type . instance_variable_get ( :@cast_type ) . respond_to? ( :sqlserver_type )
329
+ return type . instance_variable_get ( :@cast_type ) . sqlserver_type
328
330
end
329
331
end
330
332
You can’t perform that action at this time.
0 commit comments