Skip to content

Commit 93120f7

Browse files
committed
Add AttributeEncodable conformance for Bool
1 parent 0218b97 commit 93120f7

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

Sources/CoreModel/Encodable.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,18 @@ public extension ModelData {
3232
}
3333
}
3434

35-
// MARK: - Default Codable Implementation
36-
37-
extension Entity where Self: Encodable, Self.ID: Encodable {
38-
39-
// TODO: Default implementation for Encodable
40-
}
41-
4235
// MARK: - AttributeEncodable
4336

4437
public protocol AttributeEncodable {
4538

4639
var attributeValue: AttributeValue { get }
4740
}
4841

42+
extension Bool: AttributeEncodable {
43+
44+
public var attributeValue: AttributeValue { .bool(self) }
45+
}
46+
4947
extension Int: AttributeEncodable {
5048

5149
public var attributeValue: AttributeValue { .int64(numericCast(self)) }

0 commit comments

Comments
 (0)