Skip to content

Commit f7f8f5f

Browse files
committed
Making sure the fix also works with Optionals
1 parent e2f7b09 commit f7f8f5f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/ManagedModels/SchemaCompatibility/NSAttributeDescription+Data.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ extension CoreData.NSAttributeDescription: SchemaProperty {
9292
return
9393
}
9494

95-
if let valueTransformerName = valueTransformerName, newValue is any NSObjectProtocol.Type {
95+
if let valueTransformerName = valueTransformerName {
9696
self.attributeType = .transformableAttributeType
9797
self.isOptional = newValue is any AnyOptional.Type
9898

Tests/ManagedModelTests/Schemas/TransformablePropertySchema.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ extension Fixtures {
2121
var expires : Date
2222
@Attribute(.transformable(by: AccessSIPTransformer.self))
2323
var sip : AccessSIP
24+
@Attribute(.transformable(by: AccessSIPTransformer.self))
25+
var optionalSIP : AccessSIP?
2426
}
2527

2628
class AccessSIP: NSObject {

0 commit comments

Comments
 (0)